MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / SudoHandleCmd

Method SudoHandleCmd

core/utils/ssh/ssh.go:116–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116func (c *SSHClient) SudoHandleCmd() string {
117 if _, err := c.Run("sudo -n ls"); err == nil {
118 return "sudo "
119 }
120 return ""
121}
122
123func (c *SSHClient) IsRoot(user string) bool {
124 if user == "root" {

Callers 3

RunScriptMethod · 0.80
NewUfwFunction · 0.80
handleSSHPortUpdateFunction · 0.80

Calls 1

RunMethod · 0.95

Tested by

no test coverage detected