Linux command --chmod

User group concept:

  In Linux, each user belongs to a group, outside the group is not independent of Eng,

Documents Related concepts:
  the owner; where the group; other groups; the user to change a file's group;

ls view the file details

# Ls -ahl Anaconda3- 5.3 . 1 -Linux-x86_64. sh 
rw-r - r--. 1 wolf 638M July   3  05 : 57 Anaconda3- 5.3 . 1 -Linux-x86_64. sh

  The first character represents the file (-), directory (d), a link (l)

  After the character triads (r = 4, w = 2, x = 1):

    Owner of the file permissions rw- The first group read, write,

    A second set of user permissions r-- and the owner of the file is read the same group,

    The third group r-- not with the user's permission to file owner is reading the same group,

  1 shows the number of files connected

  wolf represents the user

  wolf represents user's group;

  638M July * .sh file size, date, name

## change file permissions

    1,chmod  755  filename

  2, chmod u = rwx, g = rx, o = rx filename supra u = user permissions, g = permissions user's group, o = different sets of permissions to other users

  3, chmod ux, g + w filename to remove the permissions abc performed by the user, increasing the write permission group

  4, chmod a + r filename add read access to all users

## to modify the file owner and user groups

  1, chown xiaoming abc: abc change the owner of xiaoming

  2, chgrp root abc: changes the group belongs root abc

  3, chown root ./abc: changes the owner of this directory is the root abc

  4, chown -R root ./abc: abc change the owner of the directory and all files and directories below the root

Example: to establish user groups group1 and group2 two, and three user dennis, daniel, abigale, and allocates the first two users in a user group group1, after a user group assignment in group2

 

The groupadd named group1 # 
# group2 the groupadd 
# the useradd - G named group1 Dennis 
# the useradd - G named group1 Dani 
# the useradd - G group2 sjhh 
# Set Password 
# the passwd Dennis 
# sjhh user to change the group consisting group2 becomes named group1 
# the usermod -g named group1 sjhh

 

Guess you like

Origin www.cnblogs.com/fjhdg-11/p/11131081.html