LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2014, 02:30 PM   #1
terence
LQ Newbie
 
Registered: Feb 2004
Location: Edinburgh UK
Distribution: CentOS
Posts: 19

Rep: Reputation: 0
users can't execute certain setuid commands


Hello,

I'm running CentOS 6.5 with 3.10.32-11.el6.centos.alt.x86_64 kernel.
I have the usual /etc/fstab set up to allow users to mount USB memory sticks, DVDs etc. However, sometimes I'd like to mount a device using
a different file system than that specified in /etc/fstab and I noticed that even though /bin/mount is setuid, normal users can't do
'mount -t': I get a message saying "mount: only root can do that".
Why is that, and is there anything else I can do to allow users to do
'mount -t'? I thought the whole point of setuid is that whoever executes the command does so as root?

Similarly, in new versions of linux, normal users can no longer execute ifup and ifdown, even though the relevant ifcfg- file has the line

USERCTL=yes

(There is no error message - when a user tries to execute ifup, it
just does nothing until CTL-C is pressed.) Changing the permissions
of ifup/ifdown to setuid has no effect. Again, why is that?

Of course, I know I can use 'sudo', but setuid for certain commands
seems to be a less cumbersome solution, and what is the point of setuid if normal users still can't execute those commands?

Thanks in advance for any help.
Terence
 
Old 04-24-2014, 06:56 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
If you allow users to mount anything they like anywhere they like this gives them root shells.

If you want your users to have root shells give them a sudo rule to run a root shell. They can do any mount activity they need with such a shell.

If you don't want your users to have root shells you can't let them mount except in ways you've approved. Imagine what happens after they mount over /etc/ and their supplied passwd and shadow files are in use.
 
Old 04-24-2014, 10:12 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Commands like mount offer a subset of their capabilities to the non-root user. In the case of mount, you are allowed to mount filesystems listed in /etc/fstab with the "user" or "users" option, but only with a single argument specifying either the device or the mount point plus a possible "-r" (read-only) flag. All of the other parameters must come from /etc/fstab, and those would typically include "nosuid" and "nodev" options. Giving a non-root user more control than that would be a very serious security hole.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enable sudo users execute commands by Logs su - jsaravana87 Linux - General 1 11-18-2012 10:09 PM
setuid without execute bit venmugil Linux - General 1 01-24-2010 08:57 AM
Commands to dissalow regular users to execute huxflux Linux - Security 4 02-07-2007 09:23 AM
NFS: synchronize users manually: setuid? zoubidoo Linux - Networking 8 01-01-2007 09:58 AM
what commands are setuid as default? rgiggs Slackware 3 07-21-2004 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:02 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
Open Source Consulting | Domain Registration