This option is used as default value when the host option "ssh_user" is
empty. Like the host option it defaults to an empty value which tells
`ssh` to use the current user.
DetectGroups []string `yaml:"detect_groups"`
GroupPriority []string `yaml:"group_priority"`
+
+ SshUser string `yaml:"ssh_user"`
}
func LoadConfig() (*Config, error) {
}()
// 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(user, s.host.Name, s.config.SshConfig)
if err != nil {
return err
}