The Linux user directory is in "/home". The files of non-administrator users are stored under the home directory. Each file represents the area of each user, while the Linux administrator directory is stored in "/root". "middle.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
SU (Switch user), which allows an ordinary user to switch to a super user or other users, and can temporarily have the permissions of the switched user. When switching, you need to enter the password of the user you want to switch; it can also allow a super user to switch to an ordinary user. , temporarily processing transactions with a low-privilege identity, and there is no need to enter the password of the user to be switched when switching.
Example
Assume an ordinary user trunk, first log in as trunk:
su root: Temporarily switch to the root user , you need to enter a password, the environment variables remain unchanged after switching, partial permissions of root are obtained, and only commands in the trunk user path can be used, and unique commands in the root user path cannot be used.
su - root: To switch to the root user, you need to enter a password. After the switch, the environment variables are changed, and you can do almost anything without restrictions.
su - trunk: Switch back to a normal user from root without entering a password. After switching, you only have trunk permissions.
2.1.3.2 sudo
sudo is a Linux system management command that allows system administrators to let ordinary users execute some or all root commands. A tool such as halt, reboot, su, etc. This not only reduces the root user's login and management time, but also improves security. sudo is not a replacement for the shell, it is for each command.
sudo allows ordinary users to obtain permissions without knowing the password of the super user.
The super user will change the name of the ordinary user, Information such as the specific commands that can be executed and the identity of which user or user group to execute are registered in a special file (usually /etc/sudoers), which completes the authorization of the user (at this time the user is called "sudoer ”)
The difference between su and sudo in vernacular
To put it simply, when using su to switch, you need to know the root password. Yes, when switching to sudo, you only need to know your own password, but switching to sudo requires a configuration file to take effect
3. Absolute path& Relative
3.1 Path concept
3.1.1 Absolute path
Absolute path refers to the absolute path under the directory Location, directly to the target location, usually the path starting from the drive letter.
3.1.2 Relative path
The relative path refers to the relative path caused by the path where this file is located and other files (or files folder) path relationship.
3.1.3 Vernacular Summary Take the location on the map as an example:
The above is the detailed content of Where is the linux user directory?. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn