Archived
SSH认证支持sudo
This commit is contained in:
@@ -94,7 +94,13 @@ func (this *BaseInstaller) Login(credentials *Credentials) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if credentials.Sudo {
|
||||
client.Sudo(credentials.Password)
|
||||
}
|
||||
|
||||
this.client = client
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -146,6 +152,10 @@ func (this *BaseInstaller) InstallHelper(targetDir string, role nodeconfigs.Node
|
||||
return env, err
|
||||
}
|
||||
|
||||
if len(uname) == 0 {
|
||||
return nil, errors.New("unable to execute 'uname -a' on this system")
|
||||
}
|
||||
|
||||
osName := ""
|
||||
archName := ""
|
||||
if strings.Contains(uname, "Darwin") {
|
||||
|
||||
Reference in New Issue
Block a user