0
dsmith@ip-xx-xxx-xxx-xx:~$ groups dsmith
dsmith sudo py
dsmith@ip-xx-xxx-xxx-xx:~$ sudo chmod -R g+rwxt /usr/local/virtualenvs
dsmith@ip-xx-xxx-xxx-xx:~$ ls -al /usr/local
...
drwxrwxr-x  2 root py   4096 2010-02-17 19:36 virtualenvs
dsmith@ip-xx-xxx-xxx-xx:~$ echo "Hello World" > /usr/local/virtualenvs/test.txt
bash: /usr/local/virtualenvs/test.txt: Permission denied

1 Answer 1

1

You'll need to have read (well, execute at least) on all parent directories, and write access to the file in question.

Also, groups dsmith shows what groups the dsmith user is in; while groups shows what groups the current user is in. You'll need to log in anew if they show different output.

Another thing to check is SELinux; it might be interfering.

2
  • groups returned dsmith sudo. I logged out and logged in as dsmith and it worked. A few steps back I su dsmith so I wonder if switching users instead of logging out and logging in as a different user had something to do with it. Commented Feb 17, 2010 at 21:01
  • Another thing to be aware of is that if you add the current user to a new group, that new group won't be recognized until you logout and log back in again - or su to the same user.
    – Brent
    Commented Feb 17, 2010 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .