@@ -176,7 +176,7 @@ func connectSSH(ctx context.Context, client kernel.Client, cfg ssh.Config) error
176176 if ! jsonOutput {
177177 pterm .Info .Println ("Setting up SSH services on VM..." )
178178 }
179- if err := setupVMSSH (ctx , client , browser .SessionID , publicKey ); err != nil {
179+ if err := setupVMSSH (ctx , client , browser .SessionID , publicKey , jsonOutput ); err != nil {
180180 return fmt .Errorf ("failed to setup SSH on VM: %w" , err )
181181 }
182182 if ! jsonOutput {
@@ -186,7 +186,7 @@ func connectSSH(ctx context.Context, client kernel.Client, cfg ssh.Config) error
186186 if cfg .SetupOnly {
187187 if jsonOutput {
188188 proxyCmd := fmt .Sprintf ("websocat --binary wss://%s:2222" , vmDomain )
189- sshCommand := fmt .Sprintf ("ssh -o 'ProxyCommand=%s' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i %s root@localhost" , proxyCmd , keyFile )
189+ sshCommand := fmt .Sprintf ("ssh -o 'ProxyCommand=%s' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR - i %s root@localhost" , proxyCmd , keyFile )
190190 result := sshSetupResult {
191191 VMDomain : vmDomain ,
192192 SessionID : browser .SessionID ,
@@ -240,7 +240,7 @@ func connectSSH(ctx context.Context, client kernel.Client, cfg ssh.Config) error
240240}
241241
242242// setupVMSSH installs and configures sshd + websocat on the VM using process.exec
243- func setupVMSSH (ctx context.Context , client kernel.Client , sessionID , publicKey string ) error {
243+ func setupVMSSH (ctx context.Context , client kernel.Client , sessionID , publicKey string , quiet bool ) error {
244244 // First check if services are already running
245245 checkScript := ssh .CheckServicesScript ()
246246 checkResp , err := client .Browsers .Process .Exec (ctx , sessionID , kernel.BrowserProcessExecParams {
@@ -253,7 +253,9 @@ func setupVMSSH(ctx context.Context, client kernel.Client, sessionID, publicKey
253253 } else if checkResp != nil && checkResp .StdoutB64 != "" {
254254 stdout , _ := base64 .StdEncoding .DecodeString (checkResp .StdoutB64 )
255255 if strings .TrimSpace (string (stdout )) == "RUNNING" {
256- pterm .Info .Println ("SSH services already running, injecting key..." )
256+ if ! quiet {
257+ pterm .Info .Println ("SSH services already running, injecting key..." )
258+ }
257259 // Just inject the key
258260 return injectSSHKey (ctx , client , sessionID , publicKey )
259261 }
0 commit comments