Skip to content

Commit

Permalink
fix: if the root user is not specified,sudo should be disabled. (#3598)…
Browse files Browse the repository at this point in the history
… (#3599)

Co-authored-by: 榴莲榴莲 <78798447@qq.com>
  • Loading branch information
sealos-ci-robot and ghostloda authored Jul 28, 2023
1 parent 98719a4 commit bbf88d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func newOptionFromSSH(ssh *v2.SSH, isStdout bool) *Option {
if len(ssh.PkData) > 0 {
opts = append(opts, WithRawPrivateKeyDataAndPhrase(ssh.PkData, ssh.PkPasswd))
}
if ssh.User != defaultUsername {
if ssh.User != "" && ssh.User != defaultUsername {
opts = append(opts, WithSudoEnable(true))
}

Expand Down

0 comments on commit bbf88d0

Please sign in to comment.