LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-26-2009, 03:11 PM   #1
KFC123
Member
 
Registered: May 2009
Posts: 47

Rep: Reputation: 15
How to only allow someone to su root?


How to only allow someone to su root?

I google it and see someone suggest to add a group,says admin, and add the specific user who can su root to that group, change the owner of /bin/su to that group and chmod o-rwx /bin/su

I try that, and yes, only the user I specify can su root, but even I input the password correcly, it can no more change to root. What's up? And what's the right way to do that?
 
Old 06-26-2009, 03:18 PM   #2
akiku
Member
 
Registered: Jun 2009
Distribution: Slackware
Posts: 62

Rep: Reputation: 17
You really don't want to have multiple root users.
Instead, have a look at the sudo command. It provides access for certain users to perform specific commands as the superuser.

man sudo and google will help you get it configured.
 
Old 06-26-2009, 03:24 PM   #3
KFC123
Member
 
Registered: May 2009
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by akiku View Post
You really don't want to have multiple root users.
Instead, have a look at the sudo command. It provides access for certain users to perform specific commands as the superuser.

man sudo and google will help you get it configured.
Thanks for reply. But I wonder if su and sudo the same thing?
 
Old 06-26-2009, 09:16 PM   #4
akiku
Member
 
Registered: Jun 2009
Distribution: Slackware
Posts: 62

Rep: Reputation: 17
su root allows a user to become the superuser.
sudo allows others to run specific commands as the superuser.

Allowing multiple users to su root means these users will know the root pwd, which can create a lot of issues.

sudo, on the other hand, is highly configurable and will allow multiple users to run commands that require root priviledges. But you retain the root user security and would be the only one that can configure these privileges. This is a much better option.

Of course, you could defeat this safeguard by configuring a user like this:
Code:
joeuser ALL=(ALL) ALL
But, no ordinary user needs root access to all cmds. Not sure why you would want that.
 
Old 07-07-2009, 06:32 AM   #5
cam34
Member
 
Registered: Aug 2003
Distribution: Fedora 22, Debian 8, Centos 6/7 for servers
Posts: 101

Rep: Reputation: 16
Depending on your distro you should have a pam module called wheel. Check for /lib64/security/pam_wheel.so or /lib/security/pam_wheel.so from there only users in the WHEEL group (by default) are allowed to su to root.

More information is in the man pages: man pam_wheel

We can probably help you configure it if you want..........
 
Old 07-07-2009, 02:57 PM   #6
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Also worth noting that a number of applications allow a user to "shell out" Vi is a great example.

Therefore, if someone has access to run
Code:
sudo vi file
They can then easily go into a root shell.

Last edited by Disillusionist; 07-07-2009 at 02:58 PM. Reason: Clarity
 
Old 07-08-2009, 07:13 AM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by Disillusionist View Post
Also worth noting that a number of applications allow a user to "shell out" Vi is a great example.

Therefore, if someone has access to run
Code:
sudo vi file
They can then easily go into a root shell.
And this is a fine example of why global access to commands via sudo is a really bad idea, and of how *buntu have really, really, really abused sudo.
 
Old 07-08-2009, 01:27 PM   #8
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
True, but Ubuntu only gives global sudo permissions to the first user (the one created at install) thererfore it is reasonable to assume that this would have been the person to create the root account anyway.
 
  


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
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 04:27 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 05:15 PM
On NFS, non-root users can move/rename files belonging to root. Stuart Morrow Linux - Server 2 11-05-2007 11:12 AM
why lftp command run failed when user isn't root, but ok when logining as root steven_yu Linux - Software 0 06-06-2007 08:36 PM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM

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

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