sudo -i sum sudo -s

sudo -i , load the user variables, and jump to the target user's home directory;
sudo -s, do not load user variables, not jump catalog;

 

sudo: temporarily switch to super user mode to execute superuser privileges prompted to enter the password for the password for the current user's password, rather than a super account password. However, there is a time limit, Ubuntu default is a long 15 minutes.

su: switch to a certain user mode, the password when prompted for a password to switch accounts after the passwords, usage is "su account name." If the account back without the system defaults to root account password is also super account password. no time limit.
sudo -i: In order to perform certain privileges only superusers can execute frequent, rather than each time you enter a password, can use this command. When prompted for a password the password for the current account password. no time limit. After executing the command prompt changes to "#" instead of "$." You can perform the "exit" or "logout" when you want to return an ordinary account. Required to perform the command user must only be in the sudoers

 
sudo -i directly run sudo command with the -i parameter required to execute the command the user must only be in the sudoers
sudo su command to run sudo su command mention the right to run su command. Required to perform the user command can be in the sudoers
sudo -i operation result = the PWD / the root
the sudo SU operation results PWD = / home / user name (the current user's home directory)

Guess you like

Origin www.cnblogs.com/wzk-0000/p/11083008.html