Linux study notes --- permission management

1. Change the permission group to which the file belongs

chgrp -R (for recursively changing directory files) userName dname/fname

2. Change the file owner

chown -R owning user: owning user group fname/dname

3. Change file permissions

Permissions: read 4 write 2 execute 1

chmod XXX fname/dname

 

1. User and user group creation:

    User creation: useradd -g user group username

        Delete: userdel -r username will delete the user home directory together

        Modify: usermod -g Modify the permission group to which the user belongs

  User group modification

groupmod –g 10000 -n group3 group2

This command changes the identification number of group group2 to 10000 and the group name to group3

2. View the group to which the user belongs

groups username

3. View user group information

vim /etc/group

cat /etc/group | grep test View test user group information

Guess you like

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