LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setup sudo to allow any commands in one directory (https://www.linuxquestions.org/questions/linux-newbie-8/setup-sudo-to-allow-any-commands-in-one-directory-943928/)

Kustom42 05-08-2012 02:13 PM

Setup sudo to allow any commands in one directory
 
Hi LQ,

I'm having sort of a brain lapse at the moment and cannot remember how to setup a single user to run any commands inside of one directory. They should be able to sudo execute any command, rm, cp, ls, etc.. inside of a directory.

So for example purposes lets say username is Bob and he needs to run any command in the /app/ directory. What is the syntax or a good link you can point me to to reference this setup?

Thanks in advance.

Kustom42 05-08-2012 02:16 PM

In case it matters this is a red-hat distro running sudo 1.7.4p5

Kustom42 05-08-2012 04:18 PM

After doing some more digging doesn't look like sudo allows this set-up. I thought I had done it before but maybe I am mistaken. This is definitely a piece of functionality that should be looked at though for future implementations.

Kustom42 05-08-2012 04:35 PM

Marking as solved but will monitor thread in-case anyone has some good info to throw my way.

chrism01 05-08-2012 07:01 PM

If you have a soln, please post it.
To me though, your requirement sounds more like a chroot or file ownerships question.
sudo is based on users and cmds, not dir tree location.

Kustom42 05-09-2012 11:20 AM

Yep chrism no solution with sudo, so no solution = solved I guess. There may be some alternate ways to approach it but I just gave it throughout the filesystem and called it a day.

TroN-0074 05-09-2012 11:39 AM

I have no idea what you are doing but I was interested on seeing the solution to your question. I did a search about sudo in RedHat

http://www.linuxhomenetworking.com/w...udo#Using_sudo

And still have no idea

Good luck to you!

Kustom42 05-09-2012 11:43 AM

There is no solution with sudo to limit access to specific directories. You must do it with chrooted shell access or use setuid/setgid perms. There may be an alternate software solution that someone else has created but I have yet to find it.


All times are GMT -5. The time now is 10:31 AM.