The difference between su-root and Su root

Source: Internet
Author: User

A few days ago, in a project, made a very low-level mistake, but did not understand what is the problem. This is the case, we are doing disaster preparedness, restart systematization, with root user rights, through Su Oracle, go in, Oracle's RAC does not start normally, I did not look closely, has been looking for other reasons, finally after colleagues reminded that should be executed su-oracle. Sure enough, as he said, go in and start normally.

Today suddenly remembered, and carefully review the information, make a note, memo. Also remind yourself to pay attention to the details.

Su-root is the same as Su-

Just like login as root and then the shell is login shell,
Which mean it would expericene a login process,
usually. Bash_profile and. BASHRC'll be sourced

Su Root is the same as Su
Like your open an interactive shell in Root name,
Then only. BASHRC'll be sourced.


Su does not add the user is the default cut to root
Su does not change the current variable
Su-is changing the variable to switch to the user
That is, Su can only get root execution permission, cannot get environment variable

And Su-is the environment variable and execute permission to switch to root and get root

Grammar:

$ SU [user_name] 
The SU command can be used to interactively change your user ID and group ID. SU is an abbreviation for the switch user or set user ID. This command allows you to open a subprocess, become a new user ID and give you access to all files associated with this user ID. Therefore, for security reasons, when you actually convert your identity, you will be asked to enter the password for that user account. 
If there are no parameters, the SU command converts you to root (System administrator). The root account is sometimes referred to as superuser, because the user can access any file on the system. It is for this reason that many people regard the SU command as an abbreviation for Supper-user (superuser).  Of course, you have to provide the root password. To return to your original user identity and stop using the SU command, you only need to use the Exit command to exit the new dialog process that you generated using the SU command. 
$ su–username 
Some configuration files are created for your conversation thread. When you use the command SU Username, your dialog features are the same as your original login status. If you want your conversation process to have the same characteristics as the converted user ID, you will use the short slash: Su–username.

u-root is a switch to the root account, using the root user's environment variables;
The su root is the root privilege to execute the program as root, but retains the original user environment.

Note: Some commands, even if you use SU root to switch to the root user, still cannot execute, so when switching to the root user, it is recommended to use Su-root.

This article from the "Technology Collection" blog, reproduced please contact the author!

The difference between su-root and Su root

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.