LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-30-2007, 01:04 PM   #1
ElectroLinux
Member
 
Registered: Feb 2004
Posts: 74

Rep: Reputation: 15
restrict root shell using sudo


How can I configure sudo to only allow "jdoe" to do anything he wants, but only as "jdoe" and not as "root".

I want to give root access to a select few. I don't mind them having root privs, but I want it logged so whatever is logged should show up under their name and not root. How can I do this?

I did try to just give access to /bin/sh , but once i do a "sudo sh" it will give a root shell. I want to be able to stop all ways of having a root shell so all activity is logged.
 
Old 03-30-2007, 01:19 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Effectively "sudo" runs the programs with root privileges, that's the point of using it. Restrict the usage of sudo to only those few exact commands you need and nothing else; the configuration is done in the /etc/sudoers file. I don't think it's possible, with sudo, to run programs that need root privileges as a regular user, because effectively the regular user seems to be root during the time the program is executed (meaning that the user gets granted root privileges for that action). That's very unclearly said, but I hope you understand.

You could probably wrap the command(s) into a script that the regular user can run, and the script runs the commands and possibly logs something. That's one way you can do it, but maybe others can give better ideas..
 
Old 03-30-2007, 05:07 PM   #3
Zention
Member
 
Registered: Mar 2007
Posts: 119

Rep: Reputation: 16
You probably want to go down the chroot line rather than using sudo.
 
  


Reply



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
restrict access to root / yogaboy Linux - Newbie 4 12-31-2006 08:17 AM
How to Log everything command in a root-shell started by SUDO dussel Linux - Security 13 02-21-2006 09:47 AM
allow sudo for www user to run root shell script cccc *BSD 12 07-23-2005 03:48 PM
restrict internet access to the root only anubhuti_k Linux - Security 1 02-15-2005 12:59 AM
Sudo, su and root lesleyb Linux - Security 3 10-18-2004 01:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:01 PM.

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
Open Source Consulting | Domain Registration