Can't set PWD despite having sudo permission set.
As user lukas, who is listed in 'sudoers' with the same rights as root (ie ALL=(ALL)) I can't cd 'into' dir /var/spool/cron:
(from sudoers) root ALL=(ALL) ALL lukas ALL=(ALL) ALL As root i can cd into it no problem. As lukas, i get permission denied, and if I try 'sudo cd cron' I get an error saying command 'cd' is not recognised. file permissions as follows - drwxr--r-- 2 root root 4096 2010-03-03 12:56 cron What have i done wrong? Thanks in advance spoov |
you shouldn't have to sudo to enter a directory, only to make changes to a file
so cd cron should get you in the directory |
Hi,
A normal (= none root) user cannot cd into the cron directory given in the example in post #1. The directory only has read permissions on the group and world (execute permission are also needed to cd into it). Using sudo won't change that fact (unless you sudo to root). Hope this helps. |
Quote:
Quote:
Code:
chmod o+x /var/spool/cron On a side note. Do you absolutly have to cd into that directory? Why not for example just do a Code:
sudoedit /var/spool/cron/filename Code:
sudo cat /var/spool/cron/filename |
Hi,
@zhjim: Permissions on a dir work differently then on a file. Maybe this will help: Quote:
|
Thanks druuna and zjhim. It looks like you do need execute permission to cd to a dir. I thought you only needed read permission.
zjhim - no I suppose i didn't need to cd into it, its just a habit to always cd one dir at a time and always list contents. Keeps me aware of where i am in the filesystem. |
Thanks druuna for the clarification.
I have the same habit spoovy but something I just make my life a bit more complicated as it's need to be ;) |
You are both welcome :)
|
All times are GMT -5. The time now is 01:41 PM. |