Su-Used to initialize environment variables $PATH $HOME, etc.
sudo su to root requires input of root password is not secure
visudo Edit/etc/sudoers config file no command required to install Yum install-y sudo
format: User host= (as_user) commands
For example: aming all= (Root)/bin/ls//It means, let aming this ordinary user, have root authority, for LS this command.
application: Only allow the use of ordinary account login, and ordinary account login, you can not enter the password can be sudo switch to the root account (Root does not allow remote logins)
user_alias user_su = Test, test1, aming//user alias, can write multiple users
Cmnd_alias SU =/bin/su//aliases for commands, multiple commands can be written
User_su all= (All) NOPASSWD:SU//The nopasswd means that the normal user does not need to enter their own password when using sudo.
This article is from the "Computer Network" blog, please be sure to keep this source http://reder.blog.51cto.com/10844461/1713123
Linux User identity switch