如果服务器在 /etc/sudoers 中有以下内容:
Defaults targetpw
ALL ALL=(ALL) ALL
Run Code Online (Sandbox Code Playgroud)
那么这是什么意思呢?所有用户都可以对所有命令进行sudo,只需要他们的密码?
poz*_*444 22
从sudoers(5)
手册页:
sudoers 策略插件确定用户的 sudo 权限。
对于目标密码:
sudo 将在运行命令或编辑文件时提示输入由 -u 选项(默认为 root)指定的用户的密码,而不是调用用户的密码。
sudo(8)
允许您以其他人的身份执行命令
所以,基本上它说任何用户都可以作为任何用户在任何主机上运行任何命令,是的,用户只需要进行身份验证,但使用其他用户的密码,才能运行任何东西。
The first ALL is the users allowed
The second one is the hosts
The third one is the user as you are running the command
The last one is the commands allowed
Run Code Online (Sandbox Code Playgroud)