Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm attempting to run the command

username> ls -al var/

But I get the exception

ls: cannot open directory var/: Permission denied

When I check the permission of the directory I see

drwxr-x--x  6 sysuser abbagroup   4096 2010-07-28 11:55 var

I've confirmed that my user account is part of the group

> groups username
username: abbagroup

So why can't I run the command?

share|improve this question
    
Does it show properly when you ssh or telnet to the box, as opposed to just opening a console from your desktop? –  Matt Sep 8 '10 at 21:18
    
Running sudo ls -al var/ returns drwxr-x--x 6 sysuser abbagroup 4096 2010-07-28 11:55 . drwxr-xr-x 10 sysuser abbagroup 4096 2010-09-08 12:45 .. drwx--x--x 3 sysuser abbagroup 4096 2010-07-28 11:55 lib drwx--x--x 3 sysuser abbagroup 4096 2010-07-28 11:55 log drwx--x--x 4 sysuser abbagroup 4096 2010-07-28 11:55 run drwx--x--x 5 sysuser abbagroup 4096 2010-07-28 11:55 spool –  Brig Sep 8 '10 at 21:57
    
Does id also show abbagroup for that user? –  Dennis Williamson Sep 8 '10 at 22:04

2 Answers 2

up vote 3 down vote accepted

Did you by any chance just add username to abbagroup? This kind of change takes effect when you log in, and applies to the login process and its descendants.

When you run groups username, it tells you which groups username would belong to if (s)he logged in. Run groups with no argument instead, so that it tells you which groups the current process belongs to. If that doesn't show abbagroup, you need to log out and back in.

share|improve this answer

Try

sudo ls -al var/
share|improve this answer
    
Looks like the group does to me. –  Dennis Williamson Sep 8 '10 at 21:14
    
You're right about the group :) –  tovare Sep 8 '10 at 21:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.