LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-26-2006, 09:14 AM   #1
keysorsoze
Member
 
Registered: Apr 2004
Location: Queens, NY
Distribution: Red Hat, Solaris
Posts: 295

Rep: Reputation: 30
Only specific users allowd to SU?


Hi! is there any way I can limit SU to a single particular user that I would like to have super user access and deny everyone else the ability to use the command?

Thanks.
 
Old 04-26-2006, 09:24 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
First 'su' is short for (roughly) switchuser not supersuser.....

And yes it is (already)limited to those that know the correct password(s). Keeping a hard to guess memorized root password works wonders.

When using 'su' or 'su -' without supplying a username root is used as the default user to switch to.
 
Old 04-26-2006, 09:38 AM   #3
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
edit /etc/pam.d/su and do the following:

Code:
# Uncomment the following line to require a user to be in the "wheel" group.
auth       required     /lib/security/$ISA/pam_wheel.so use_uid
Then add the user you want to be the only one to access su to the wheel group:

Code:
$ gpasswd -a [user] wheel
HTH,
Mike.

Last edited by mikeyt_333; 04-26-2006 at 09:41 AM.
 
Old 04-26-2006, 11:04 AM   #4
tr4nsfix
Member
 
Registered: Mar 2004
Location: Toronto, Ontario
Distribution: Debian
Posts: 36

Rep: Reputation: 15
You can also use the sudo package for this.

With sudo you can specify the users or groups which have access to specific commands.
For example your /etc/sudoers might look something like this:

Cmnd_Alias SU_ACCESS = /bin/su -
User_Alias SU_USERS = bob, john, sam, fred

SU_USERS ALL = (ALL) SU_ACCESS


In this case the user(s) would have to run the following to su to the root user:
sudo /bin/su -
 
Old 04-26-2006, 12:10 PM   #5
keysorsoze
Member
 
Registered: Apr 2004
Location: Queens, NY
Distribution: Red Hat, Solaris
Posts: 295

Original Poster
Rep: Reputation: 30
Thanks the PAM solution looks like its the best solution for my scenario. Thanks
 
  


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
block specific users in squid alan.belizario Linux - Security 4 09-09-2005 11:43 PM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
ip masquerading specific users FiveFlat Linux - Security 7 08-10-2004 03:55 PM
Display users on specific Port peter_jansen Linux - Networking 4 06-01-2004 03:22 PM
Specific users mounting cdroms sportjeep99 Linux - General 1 06-07-2001 06:12 AM

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

All times are GMT -5. The time now is 12:54 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