Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The difference between su-root and su root

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

A few days ago, I made a very low-level mistake in a project, but I didn't figure out what the problem was. The situation is like this, we are doing disaster preparedness, restart systematically, with root user rights, through su oracle, after entering, the rac of oracle cannot be started normally. I have been looking for other reasons without looking carefully. Finally, I was reminded by my colleague that su-oracle should be implemented. As he said, it started normally after going in.

Today, I suddenly remembered, examined the information carefully, and made a note and memo. Also remind yourself to pay attention to details.

Su-root is the same as su-

Just like login as root, then the shell is login shell

Which mean it will expericene a login process

Usually .bash _ profile and .bashrc will be sourced

Su root is the same as su

Like you open an interactive shell in root name

Then only .bashrc will be sourced.

If the user is not added after su, it is switched to root by default.

Su does not change the current variable

Su-is a variable that is changed to switch to the user

That is to say, su can only get the execute permission of root, but not environment variables.

Su-is to switch to root and get the environment variable and execution permission of root.

Syntax:

$su [user_name]

The su command can be used to interactively change your user ID and group ID. Su is an abbreviation for switch user or set user id. This command allows you to start a subprocess, become the new user ID and give you access to all files associated with that user ID. Therefore, for security reasons, you will be asked to enter the password of this user account when you actually change your identity.

If there are no parameters, the su command converts you to root (system administrator). The root account is sometimes called a superuser because this user can access any file in the system. For this reason, many people see the su command as an acronym for supper-user. Of course, you must provide the root password. To get back to your original user identity, instead of using the su command, you just need to use the exit command to exit the new conversation process that you generated using the su command.

$su-username

Some profiles are set up for your conversation clues. When you use the command su username, your conversation characteristics are the same as your original login identity. If you want your conversation process to have the same characteristics of the converted user ID, you should use a short slash: su-username.

U-root is used by switching to the root account and using the environment variable of the root user.

Su root obtains the privilege of root and executes the program as root, but retains the original user environment.

Note: some commands cannot be executed even if you use su root to switch to root users, so when switching to root users, it is recommended to use su-root.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 235

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report