feat: auto-accept only new SSH host keys using "-o StrictHostKeyChecking: accept-new" (#303)

* feat: add "StrictHostKeyChecking no" to ssh

Disable host key checking to prevent interaction with ssh.

Fixes: #297

Signed-off-by: Miek Gieben <miek@miek.nl>

* use accept-new instead of no

Signed-off-by: Miek Gieben <miek@miek.nl>

* fix tests

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix tests here as well

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2026-04-14 18:00:59 +10:00
committed by GitHub
parent 9cfcf49d28
commit e8111a419f
4 changed files with 18 additions and 15 deletions
+2
View File
@@ -131,6 +131,8 @@ func (c *SSHCLIConnector) buildSSHArgs() []string {
// Disable interactive prompts (e.g., passphrase input) to prevent interference with the TUI.
// Authentication must succeed non-interactively via SSH agent or unencrypted key.
args = append(args, "-o", "BatchMode=yes")
// Disable host key checking for parity with go+ssh.
args = append(args, "-o", "StrictHostKeyChecking=accept-new")
// Disable pseudo-terminal allocation to prevent SSH from executing as a login shell.
args = append(args, "-T")