diff --git a/connection.go b/connection.go index c9c808c8..b0f2aa50 100644 --- a/connection.go +++ b/connection.go @@ -294,7 +294,7 @@ func (c *Connection) configureSudo() { c.sudofunc = sudoNoop return } - if c.Exec(`sudo -n true`) == nil { + if c.Exec(`sudo -n -l`) == nil { // user has passwordless sudo c.sudofunc = sudoSudo return