Skip to main content

linux - Why cant a group member modify a file in a group he is part of?



-edit- i figured it out. I needed to use adduser username group instead.



I added a user with the command




useradd -G myapp_user newusername


then i changed the group on the public folder that i want the user to access. Here is the line using ls -l I see the group has been set.



drwxrwxr-x 3 root myapp_user 4096 Jul  9 19:13 public


I cd into it and do it again to and i see files like the below with the group. I also see rwx on both the public folder and on the content inside the directory.




-rwxrwxr-x 1 root myapp_user   4403 Oct 10  2007 info.png


Then i login as the user and CD into the folder i wrote touch a and i got a permission error. I cant add, delete or do anything even though i see 775 is the permission. I also tried useradd -G myapp_user newusername to find the user is already part of the group



what am i missing? am i suppose to flush something before it takes effect? restart something? why cant the user modify anything in the public folder?



using putty and winscp. But right now just putty.




-edit- i wrote id newusername and got the below. Why isnt the groupname included?!



uid=1000(newusername) gid=1000(newusername) groups=1000(newusername)

Answer



use adduser username group instead


Comments