4

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?

3
  • Does it show properly when you ssh or telnet to the box, as opposed to just opening a console from your desktop?
    – Matt
    Commented Sep 8, 2010 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
    Commented Sep 8, 2010 at 21:57
  • Does id also show abbagroup for that user? Commented Sep 8, 2010 at 22:04

2 Answers 2

4

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.

0

Try

sudo ls -al var/
2
  • Looks like the group does to me. Commented Sep 8, 2010 at 21:14
  • You're right about the group :)
    – tovare
    Commented Sep 8, 2010 at 21:25

You must log in to answer this question.

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