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
+1
View File
@@ -33,6 +33,7 @@ func NewSSHCLIRemote(user, host string, port int, keyPath string) *SSHCLIRemote
func (r *SSHCLIRemote) newSSHCommand(ctx context.Context, cmd string) *exec.Cmd {
args := []string{
"-o", "ConnectTimeout=5",
"-o", "StrictHostKeyChecking=accept-new",
// Disable pseudo-terminal allocation to prevent SSH from executing as a login shell.
"-T",
}