您的位置:首页 > 其它

sudo su user 和 sudo user 的区别

2013-08-06 13:19 288 查看
“sudo” lets you run commands in your own user account with root privileges. It uses a config file (/etc/sudoers) which lists which users have rights to specific actions (run commands as root, etc.) When invoked, it asks for the password of the user who started it.

[user1@server]$ sudo users

[sudo] password for user1:

“ su “ lets you switch user so that you're actually logged in as root. It starts another shell instance with privileges of the target user.

To ensure you have the rights to do that, it asks you for the password of the target user. As we enabled you to switch user through cfengine,It won’t ask you for target password.

[user1@server]$ sudo su user2

[user@server]$
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: