Permission representation & management in linux

1. Ordinary user and privileged user su command to switch users

There are ordinary users and privileged users in Windows. The privileged user is Administrator, and there can be many ordinary users.
Privileged users are the administrators of the system and have operational rights to all files in the system. Each ordinary user can only process his own files, and cannot access the files of other users, let alone handle the files of the operating system at will.
There are also distinctions between normal users and privileged users in Linux. The privileged user is the root user. Ordinary user permissions are restricted, for example, ordinary users cannot
cd /root, and ordinary users cannot use apt-get install to install software. You can use the su username to switch between different users. For example, to switch from an ordinary user to root, you can su root, and then enter the root password to switch to the root user. To switch from root to ordinary user gec, just su gec. 2. rwx and permissions indicate that ls -l displays detailed information drwxr-xr-x 10 characters, the first one indicates the file type. The remaining 9 are divided into 3 groups, representing file permissions. The first three represent the permissions of the owner of the file to the file, the middle of the group where the owner of the file belongs to the file, and the last three represent the permissions of other users to the file. How to parse rwx: r for readable, w for available Write, x stands for executable rwx: readable, writable, executable rx: readable, not writable, executable r--: readable, not writable, not executable 3. Use sudo to temporarily gain root privileges




















This is a feature of ubuntu. In ubuntu, you can use the sudo command to allow ordinary users to temporarily obtain the authority of the root user without having to switch users.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326304299&siteId=291194637