LINUX file directory permissions

1, su and su - differences
under the current user's home directory still su after switching users, the switch does not switch to the user's home directory
su - at the user's home directory switched after switching users is to change the current user environment variables. Therefore, by switching the user su - Command

2, sudo user command, is to give ordinary users decentralization root user
visudo or / etc / sudoers can edit the file to the appropriate users decentralization, it is recommended to use the visudo command can verify whether the command wrong

root ALL = (ALL) ALL
root: to be able to use the sudo command user
ALL: to be able to use sudo host
(ALL): after using sudo in what capacity execute command can also be written as (root)
ALL: Permits users can run which commands (command represents the full path)

sudo -l command to view the sudo configuration file

When the majority of ordinary users need permission, a small part when you can not use! It negated to decentralization

File directory permissions settings

File permissions
rwx write execution
R & lt. 4
W 2
X. 1
U indicates the owner
g represents all groups
o represents others
modify file permissions method
chmod 755 filename
chmod ugo + x filename

Directory Permissions

rwx read-write execution
r 4 can view the contents of a directory LS
w 2 in the directory can create, delete, rename
x 1 has permission to enter the directory cd

Modify the method directory permissions
chmod 755 directory name
chmod ugo + x directory name

Most Linux system files and directories permissions are set to 644 and 755
documents to the greatest privileges is 666
directory permissions to the maximum is 777
because umask value set in the system is 0022
umask modify / etc / profile

File permissions to view the hidden attribute modification method
to view hidden file attribute lsattr file name
modify file permissions to hide
the chattr
A can not be modified can not remove
i can not change can not remove
the chattr + A
the chattr + i
the chattr -a
the chattr -i

MD5 encryption, to make a fingerprint file encryption, generates a fingerprint file, when the source file is modified ***, verify the encrypted file to know, commonly used in regular mission
command:
md5sum passwd generate encrypted fingerprint serial number
md5sum passwd> passwd. txt files encrypted fingerprint input passwd.txt
md5sum -c passwd.txt fingerprint verification file when the source file is modified, authentication will be given at this time
LINUX file directory permissions

Guess you like

Origin blog.51cto.com/13858002/2428850