why it is not possible to modify file in a directory, where i have read/write group rights

StackOverflow https://stackoverflow.com/questions/11013046

  •  14-06-2021
  •  | 
  •  

문제

I am currently messing around on my linux system and now I have the following situation.

The directory /srv/http has the following permissions set:

drwxrwxr-x 2 root httpdev  80 Jun 13 11:48 ./
drwxr-xr-x 6 root root    152 Mar 26 13:56 ../
-rwxrwxr-x 1 root httpdev   8 Jun 13 11:48 index.html*

I have created the group httpdev before with the command:

groupadd httpdev

and added my user sighter with:

gpasswd -a sighter httpdev

Then I have set the permissions as above using the chown and chmod commands.

But now I am not allowed to modify the index.html file or create a new file, as user sighter ,with touch like that:

<sighter [bassment] ~http> touch hallo.php
touch: cannot touch `hallo.php': Permission denied

What do I understand wrong. I was expecting that I can do what I want there then the group has all the rights.

The following Output is for your information.

<sighter [bassment] ~http> cat /etc/group | grep sighter
...
httpdev:x:1000:sighter
...

The used linux-distro is archlinux.

도움이 되었습니까?

해결책

Adding a user to a group does not affect currently running sessions. So you have to logout and login again or use su - sighter to login.

After this you should be able to do what you want to do.

다른 팁

You're not in the right group. You need to log out and back in again. Also, superuser.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top