[sudo-users] how to implement *CD* under sudo

Todd C. Miller Todd.Miller at courtesan.com
Mon Jun 28 10:55:22 EDT 2004


The simple answer is "you can't".

Basically, you need to do the "cd" as part of a shell command.
E.g.
    sudo sh -c "cd /somedir; do something".

The simplest way to do this is probably to have some simple scripts
that do the specific tasks you need done and give the users sudo
for that.

If that won't meet your needs you should consider using normal Unix
groups and making the directories in question group readable/executable.

 - todd



More information about the sudo-users mailing list