The biggest difference between the two sudo su command is:
sudo command to enter the current user password, su command to enter the root password. Another difference is that the default behavior. sudo command only allowed to run a single command with elevated privileges, while su command will start a new shell, while allowing the use of root privileges to run as many commands until clear Log.
su to switch to a different identity of the user
Just switch the default identity, and not switched environment variables, environment variables are still ordinary users. When switching user identity, user environment variables are also switching to the new user's environment variables, "-" can not be omitted, otherwise some operations can not be performed.
su root Enter root password for the root user to switch but the same directory pwd
su - root user after the handover, but the root password pwd root directory / root
sudo command is generally added
sudo -i root and sudo - root, sudo -i, sudo -, sudo root effect prompted for a password identical to the password for the current account password required to perform the user command can be su after switching is required in the account sudoers the secret is the use "su account name."
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, you 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 -i added directly run sudo command parameters required to perform the user command can be in the sudoers
sudo su command to run sudo su command mention the right to run su command. Required to perform the command user must only be in the sudoers.