}()
// Connect to remote host
- err := conn.DialSSH(s.host.SshUser, s.host.Name, s.config.SshConfig)
+ user := s.host.SshUser
+ if user == "" {
+ user = s.config.SshUser
+ }
+ err := conn.DialSSH(rpc.SSHConfig{
+ Host: s.host.Name,
+ User: user,
+ SshConfig: s.config.SshConfig,
+ })
if err != nil {
+ conn.Kill()
return err
}
defer conn.Kill()