我在本地服务器上设置了一台ubuntu机器。我有一个具有sudo权限的用户(与登录密码相同)。
通过将我的rsa公钥放在ubuntu机器上,我得到了无密码ssh。所以我可以从我的Mac中删除。但是当我通过ssh登录时,我尝试sudo,它告诉我密码无效。
这是怎么回事?这是我的/ etc / sudoers
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
2
您是否收到密码失败(登录无效)错误?或者什么都没发生?
—
Kinnectus 2014年
您可能希望包含sudo配置。
—
mdpc 2014年
您是否尝试使用密码登录,只是为了检查您的密码是否正确?
—
2014年
如果两台机器的密码不同,您是否输入了正确的密码?
—
Ruslan Gerasimov 2014年
我很抱歉,再试一次,所以密码失败了。我输入了正确的密码。如果我在机器上,用户可以使用sudo的密码。附加sudo配置。
—
Ethan