In addition to R, W, and X, file permissions include S, T, I, and:
S: Set SUID and guid for the file owner and group. The file will be executed as root after the s permission is set. When setting the s permission, the file owner and owner group must first set the corresponding x permission, otherwise, the s permission does not take effect. (The C h m o d command does not perform necessary integrity checks. Even if the s permission is set without the X permission, chmod will not report an error, when LS-L is used, we can see RWS. If uppercase S is used, the s permission does not take effect ). In Linux, passwd is set to suid.ProgramNormal users do not have the permission to read/etc/shadow files and can change their passwords.
Ls-Al/usr/bin/passwd
-Rwsr-XR-x 1 Root 32988/usr/bin/passwd
We can set the s permission in character mode: chmod A + S filename, or set it in absolute mode:
Set s u I D: Set the one before the corresponding permission bit to 4;
Set g u I D: Set the one before the corresponding permission bit to 2;
Both are set to 4 + 2 = 6.
For example: chmod 4764 filename // set SUID
T: Set the adhesion bit. A user who can read and write a file must have the permission to delete the file. If the file has the T permission set, only the owner and root have the permission to delete the file, use chmod + T filename to set T permissions.
I: permission cannot be modified. For example, if chattr U + I filename is used, the filename file cannot be modified. If you need to modify the file, delete the I permission first and use chattr-I filename. Check whether the file has set the I permission to use lsattr filename.
A: Only append permissions are available for the log system. This permission allows the target file to be appended, not deleted, and not appended through the editor. You can use chattr + A to set the append permission.
In Linux, the user in a folder is a and wants to change it to user B! How to Use usermod?
Su to root
Chown B yourdir
Chgrp B yourdir
In the group file:
Zzg: X: 550: litong, liuhong
What does this mean? What does that number mean?
In passwd:
Liuhong: X: 544: 550:/usr/local/resin/webapps:/bin/bash
What does the number mean?
How can I change the liuhong permission?
Linux is a multi-user, multi-task operating system ), other users that can share the system can be divided into users in the same group (group users) and users in different groups (other users ).
Zzg: X: 550: litong, liuhong
Group name zzg password X in Shadow Group ID number 550 users in the group have litong, liuhong
Liuhong: X: 544: 550:/usr/local/resin/webapps:/bin/bash
Username liuhong password X in shadow user id544 group id550 description is empty user home directory/usr/local/resin/webapps initial logon shell is/bin/bash
Modify the O-rwx attribute of the specified directory to restrict access by other users. Change the user's group to a non-directory group;
You can also modify the go-rwx attribute of a specified directory to restrict access from other users and members of this group.
The root user uses chown and can specify the File Permission to the user. the user's own file can use chmod to set the file access permission.
Permission change: chmod g + W Folder/file name
Chmod o + W Folder/file name