mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-27 11:33:33 +00:00
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:
@@ -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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user