File permission woes on an Ubuntu ec2 instance

Posted by Pardoner on Server Fault See other posts from Server Fault or by Pardoner
Published on 2012-10-25T13:32:43Z Indexed on 2012/10/25 17:02 UTC
Read the original article Hit count: 252

Filed under:
|
|
|

I've set up an amazon ec2 instance and I'm have some file permission issues. I've created myself a new user and added myself to the following groups:

adm:x:4:me,ubuntu
sudo:x:27:me
www-data:x:33:me,www-data
ssh:x:108:me
admin:x:111:me
ubuntu:x:1000:www-data,me
me:x:1001:me

but when I cd /var/www I can't do simple commands without doing sudo. So I chown -R www-data:www-data /var/www to ensure that I'm in the owning group but I still have to type sudo for everything. If I sudo su www-data it works fine. Since I'm in the www-data group shouldn't I have the same privilages as www-data?

One strange thing I'm noticing is that when I ls -l it list the owner but not the group names. Could this possibly be part of the issue? Is is posible for a directory to not be part of a group?

drwxr-xr-x  4 www-data 4.0K Oct 24 16:39 .
drwxr-xr-x 14 root     4.0K Oct 10 16:58 ..
drwxrwxr-x  9 www-data 4.0K Oct 23 04:03 admin.mywebsite.com
drwxrwxr-x  2 www-data 4.0K Oct  4 00:29 mywebsite.com
drwxrwxr-x  9 www-data 4.0K Oct 23 04:03 staging.mywebsite.com

Edit : It appears I had some alias messing with my ls command. By calling \ls -l I can see that all my files are in the correct group.

© Server Fault or respective owner

Related posts about linux

Related posts about ubuntu