Difference between Su root, sudo Su, and Sudo-I

Source: Internet
Author: User

This su root is a command for switching users, and root is the user name. You need to enter the password of the root account, but Ubuntu disables root login, so I set a strange password for the root user. It is not the password you set when installing it, but it can be used to enable the root user. However, we recommend that you do not enable it, add sudo in front of what root permissions should be used. If you do not enable it, you will not be able to log on. Naturally, sudo root cannot log on after entering the password. If sudo Su is followed by nothing, it will be transferred to the root account by default. The root account in your machine is the Super permission. Sudo is the user you are currently logged on to, and the password is your password. In addition, the super permission change user does not need to be replaced by the user's username, so it goes to root, as Sudo-I is the same, the Sudo-I option refers to changing the shell environment parameters as the target user, and you do not specify the target, so the root is selected by default, in addition, the environment parameters are changed to root, which is the same as root login shell.

 

 

Assume that a common user trunk first logs in to the trunk: The su root temporarily switches to the root user and requires a password. After the switch, the environment variables remain unchanged and some root permissions are obtained, only commands in the path of the trunk user path can be used, and the unique commands in the path of the root user path cannot be used. The Su-root switch is a root user and requires a password. After the switch, the Environment Variables change and almost everything can be done without restrictions. The Su-trunk is switched from root to normal user without a password. After the switch, only the trunk permission is granted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.