LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-28-2005, 04:45 PM   #1
grautu
Member
 
Registered: Jul 2005
Posts: 142

Rep: Reputation: 15
permission to mount


Hi!
This thread concerns the permissions, the owner, and the group associated with the executable file /bin/mount
Code:
rwsr-xr-x	root	bin
Let's deal with the 's' permission above. The permissions tutorial <http://www.dartmouth.edu/~rc/help/faq/permissions.html> tells about that 's': "in the place where 'x' would normally go is called the set-UID or set-groupID flag. On an executable program with set-UID or set-groupID, that program runs with the effective permissions of its owner or group."
Some questions I cannot answer at this point.
(1) From the very practical point of view: how can I set x-permission to mount, for me (I mean for the single non-root user of my Slackware system)? Of course, I'm interested to set such an x-permission without identifying the user which I am to the root of my system.
(2) Notice that my previous question actually pertains to the already quoted "effective permissions of its owner or group" to execute the /bin/mount command (see the tutorial above). Concretely: what does it mean and how can be set an effective permissions of its owner or group, in terms of Linux commands?
(3) Having in mind that 'rwxr-xr-x' also reads as '755', what is the number reading of 'rwsr-xr-x', if any? In fact, is there any number reading for 's' permissions? If negative, that would actually prove that the literal and the numerical forms of permissions cannot express completely identical settings.
Could anybody please help me to understand and to configure my user permission?
Thanks!
 
Old 10-28-2005, 05:15 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Re: permission to mount

Quote:
Originally posted by grautu

(1) From the very practical point of view: how can I set x-permission to mount, for me (I mean for the single non-root user of my Slackware system)? Of course, I'm interested to set such an x-permission without identifying the user which I am to the root of my system.
The "s" bit or the setuid bit that you see in place of the "x"that would otherwise be there, does not mean that the command is not executable! The "mount" command is executable for everyone. The "s" just masks the "x" that is underneath.

Quote:

(2) Notice that my previous question actually pertains to the already quoted "effective permissions of its owner or group" to execute the /bin/mount command (see the tutorial above). Concretely: what does it mean and how can be set an effective permissions of its owner or group, in terms of Linux commands?
When setting the "setuid" bit and making "root" the owner of the file, it means that "root" is the effective user running the command when you (the user behind the keyboard) start it. The mount command needs those root rights for the short period that it is active, to do the actual mounting. This is why setting the "s" bit is often considered dangerous; you should use it only with the programs (like mount) that need it. If the program contains a vulnerability (a bug), an attacker can use the setuid bit to get root rights and do all kinds of interesting stuff to your machine.

Quote:

(3) Having in mind that 'rwxr-xr-x' also reads as '755', what is the number reading of 'rwsr-xr-x', if any? In fact, is there any number reading for 's' permissions? If negative, that would actually prove that the literal and the numerical forms of permissions cannot express completely identical settings.
Could anybody please help me to understand and to configure my user permission?
Thanks!
There is actually a fourth octal number that you use to set the "s"bit (and others). Like you said,
'rwxr-xr-x' equals '755'. Now,
'rwsr-xr-x' equals '4755',
'rwxr-sr-x' equals '2755' (this is the "setgid" bit) and finally,
'rwxr-xr-t' equals '1755' (this is the "sticky" bit, used for instance on the /tmp directory).

Read all about it in man chmod

Cheers, Eric
 
Old 10-28-2005, 05:56 PM   #3
grautu
Member
 
Registered: Jul 2005
Posts: 142

Original Poster
Rep: Reputation: 15
Thanks Alien Bob!
Now I know the significance of "exotic" octal numbers such as '4755' etc. Meanwhile I have imagined a concrete form of effective permissions of its owner which doesn't need any bit of time to identify the user and root and which reasonably solves the concrete problem on how to get mount permission without being root. The solution applies to concrete devices to be mounted, such as specified floppy and/or specified CD/DVD drives, specified partitions etc. Concretely, one mounts them in /etc/fstab, but does it with noauto option and selective permission for some users. As a consequence, the device is not actually mounted but everyone of the selected users can mount it effectively without being root. Otherwise, the mount command is inaccessible to me as a user (machine's message: "only root can do that").
Thanks!

Last edited by grautu; 10-28-2005 at 06:05 PM.
 
Old 10-29-2005, 05:25 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
The "noauto" keyword in a line in /etc/fstab does indeed mean that the corresponding filesystem is not mounted when the PC boots or when you run mount -a on the command line.
Also, when you (as user) try to mount the partition yourself, you will get the error response "only root can do that". This has nothing to do with the setuid on the /bin/mount program... if you want to let "normal" users mount a partition, or a CDROM for instance, you should add the keyword user to the line in /etc/fstab just like this example:
Code:
/dev/cdrom       /mnt/cdrom       auto        noauto,user,ro   0   0
Using this line, everyone (not just root) can mount the CD in the drive.
The word "user" is to be used literally! You must not substitute the name of an actual user like yourself.

Eric
 
  


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
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
no write permission on NTFS mount zchoyt Linux - General 1 08-25-2005 09:10 PM
cannot mount anything; I'm denied permission help! DemoniX Slackware 5 08-07-2005 11:04 AM
mount: permission denied (in root) kyrian Mandriva 1 02-29-2004 01:53 PM
mount -- changing directory permission newbie_jubie Linux - Software 5 02-15-2002 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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