diff --git a/pkg/ssh/ssh.go b/pkg/ssh/ssh.go index da7a4aca..c403cc35 100644 --- a/pkg/ssh/ssh.go +++ b/pkg/ssh/ssh.go @@ -2,6 +2,7 @@ package ssh import ( "os/user" + "time" "github.com/AlecAivazis/survey/v2" "github.com/kevinburke/ssh_config" @@ -71,7 +72,7 @@ func New(domainName, sshAuth, username, port string) (*simplessh.Client, error) if sshAuth == "identity-file" { var err error - client, err = simplessh.ConnectWithAgent(hostConfig.Host, hostConfig.User) + client, err = simplessh.ConnectWithAgentTimeout(hostConfig.Host, hostConfig.User, 5*time.Second) if err != nil { return client, err } @@ -85,7 +86,7 @@ func New(domainName, sshAuth, username, port string) (*simplessh.Client, error) } var err error - client, err = simplessh.ConnectWithPassword(hostConfig.Host, hostConfig.User, password) + client, err = simplessh.ConnectWithPasswordTimeout(hostConfig.Host, hostConfig.User, password, 5*time.Second) if err != nil { return client, err }