Got it

Linux file permission control command

Latest reply: Jan 9, 2019 09:21:53 1104 7 13 0 0

Use "+" to set permissions and "-" to cancel

Ls -lh display permission

Ls /tmp | pr -T5 -W$COLUMNS Divide the terminal into 5 columns

Chmod ugo+rwx directory1 Sets the owner (u), group (g), and others (o) of the directory to read (r), write (w), and execute (x) permissions

Chmod go-rwx directory1 delete group (g) and other people (o) read and write permissions to the directory

Chown user1 file1 changes the owner property of a file

Chown -R user1 directory1 Change the owner property of a directory and change the properties of all files in the directory.

Chgrp group1 file1 group of changed files

Chown user1:group1 file1 changes the owner and group properties of a file

Find / -perm -u+s List all files in the system that use SUID control

Chmod u+s /bin/file1 Set the SUID bit of a binary file - the user running the file is also given the same permissions as the owner

Chmod u-s /bin/file1 disables the SUID bit of a binary file

Chmod g+s /home/public sets the SGID bit of a directory - similar to SUID, but this is for the directory

Chmod g-s /home/public disables the SGID bit of a directory

Chmod o+t /home/public Set the STIKY bit of a file - only legal owners are allowed to delete files

Chmod o-t /home/public disables the STIKY bit of a directory


xiaomumu
xiaomumu Created Dec 20, 2018 01:47:37 (0) (0)
Is there any command to uninstall the program  
In addition to these, Linux has no other security configuration?
View more
  • x
  • convention:

Chmod is an useful command
View more
  • x
  • convention:

The linux command is helpful
View more
  • x
  • convention:

the function of sitch U and S is less commonly used. good sharing.
View more
  • x
  • convention:

you can use change mode
View more
  • x
  • convention:

Linux file permissions as below :
1. Basic permissions: r (read) / w (write) / x (execute) / - (no permission)
command #chmod permission filename
file owners ==> u (owner) / g ( group) / o (others) ==> -rwxrwxrwx
examples,
#chmod +rw filename ==> -rw-rw-rw-
#chmod g+rwx filename ==> -r--rwxr--
#chmod o-rwx filename ==> -rwxr-x---
or,
#chmod 741 filename
read=4 / write=2 / execute=1
2. Special permissions:
suid=>give permission to user to change in files that can't be updated by non-root accounts
sgid=>inherit the permissions of the group to the files created under it
sticky bit=>the file can be deleted only by the owner, or the root
suid=4 / sgid=2 / sticky bit=1
exmaples,
#chmod 4777 filename
#chmod 2777 directory
#chmod 1777 directory
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.