Users still do not have the right to operate when they join other user groups.

created two users and added one user to the other user group without permission to operate
system: Ubuntu18.04
details:
drwxrwxr-x 2 www www 4096 July 4 10:15. /
drwxr-xr-x 6 root root 4096 July 4 10:14.. /
-rwxrwxr-x 1 www www 0 July 4 10:15 index.txt*

xun@xun-fyjh:/home/www$ rm-rf index.txt
rm: cannot delete "insufficient index.txt": permissions

xun@xun-fyjh:/home/www$ id xun
uid=1000 (xun) gid=1000 (xun) group = 1000 (xun), 1003 (www)

xun@xun-fyjh:/home/www$ groups xun
xun: xun www


The

command id prints the group information of the currently logged-in user, while id < username > queries the user's group information from the database.

when the two results are inconsistent, you need to log in again to update the group information.

Menu