LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-08-2012, 02:13 PM   #1
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 05-08-2012, 02:16 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Original Poster
Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
In case it matters this is a red-hat distro running sudo 1.7.4p5
 
Old 05-08-2012, 04:18 PM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Original Poster
Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 05-08-2012, 04:35 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Original Poster
Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Marking as solved but will monitor thread in-case anyone has some good info to throw my way.
 
Old 05-08-2012, 07:01 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
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.
 
Old 05-09-2012, 11:20 AM   #6
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Original Poster
Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 05-09-2012, 11:39 AM   #7
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
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!
 
Old 05-09-2012, 11:43 AM   #8
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Original Poster
Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Commands over SSH using Sudo metallica1973 General 11 02-21-2012 12:05 PM
[SOLVED] sudo passwordless commands segmentation_fault Linux - Newbie 4 05-28-2011 09:07 PM
[SOLVED] Allow commands without SUDO Touch Linux - Newbie 6 01-05-2011 08:33 AM
Limited 'sudo' commands Casket Linux - Security 1 10-23-2007 02:05 AM
sudo and at commands ulto Programming 2 05-01-2004 08:36 AM


All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration