「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. shell
[user1@server]$ sudo usersspa
[sudo] password for user1: server
「 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.ci
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. get
[user1@server]$ sudo su user2it
[user@server]$io