LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-31-2004, 12:37 PM   #1
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Rep: Reputation: 30
how to use 'mount' as user


I want users on my system to be able to use 'mount' without being root. This is a slackware system. chmod and chown didnt seem to help...
 
Old 10-31-2004, 12:49 PM   #2
Joubert79
Member
 
Registered: Jul 2004
Location: Manchester, UK
Distribution: Gentoo
Posts: 46

Rep: Reputation: 15
Add the option 'user' to the /etc/fstab line for the device you want users to mount, for instance I allow user mounting of the CD so I have
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro,user,exec 0 0

See the man page for mount 'cos the option 'user' implies other options you may wish to override, eg noexec in the above example.

Last edited by Joubert79; 10-31-2004 at 12:50 PM.
 
Old 10-31-2004, 01:41 PM   #3
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
cool. Also the original permissions to /bin/mount were -rwsr-xr-x what is the 's' and how do I chmod it back to 's'.
 
Old 11-01-2004, 05:19 AM   #4
Joubert79
Member
 
Registered: Jul 2004
Location: Manchester, UK
Distribution: Gentoo
Posts: 46

Rep: Reputation: 15
That bit says that the process should run under the owners user id. So in this case, when executed by a common user, /bin/mount will get root privileges. As root do
chmod a+rx,u+ws /bin/mount
That is, read and execute permissions for all users, write permissions and SUID for the owner.

Regards,
Chris.
 
Old 11-01-2004, 06:01 AM   #5
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
While we're on the subject, I have tried this method to allow a Samba share to be mounted from an ordinary user account. The line in /etc/fstab reads:

//<IP address>/<share name> /media/Mac smbfs uid=****,gid=***,noauto,users 0 0
edited to remove IP address & IDs, for reasons of paranoia

I know that the entry is valid, as it allows me to mount the share simply with mount /media/Mac. However, I can still only do this by suing as root. Is this due to the fact that (as I understand it) mount -t smbfs... calls smbmnt rather than performing the mount directly? Does anyone know a way around this?

Thanks,
Rob

Last edited by Robhogg; 11-01-2004 at 06:06 AM.
 
Old 11-01-2004, 09:22 AM   #6
Joubert79
Member
 
Registered: Jul 2004
Location: Manchester, UK
Distribution: Gentoo
Posts: 46

Rep: Reputation: 15
It is possible if the user attempting to mount the smbfs owns the mount point directory and has rwx permissions on it. From the look of smbmnt.c, this is as good as it gets. Group ids are not checked, so I don't know how you might have a common directory to which all users mount the share.

A word of note, with the `users' option another user could unmount the share from under your nose. Instead I would suggest the `user' option. However, smbmnt does not write the mounting user to /etc/mtab so only root can unmount the share with the umount command, therefore use smbumount as a user to unmount the smbfs and this way only the mounting user can unmount again.

Check out https://bugzilla.samba.org, bug 1617 discusses the issue of user mounting.

Last edited by Joubert79; 11-01-2004 at 09:38 AM.
 
Old 11-02-2004, 02:49 PM   #7
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
Thanks for the advice, Joubert. I changed the ownership of the directory in which the share was mounted. It still insisted, however, that smbmnt needed to have the suid bit set. I guess I need to make a decision between ease and the additional risks involved in this.

Rob
 
  


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
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 10:03 AM
user cannot mount? emanresu Linux - Newbie 4 12-08-2005 07:00 AM
User Mount LinuxNoob1234 Linux - Newbie 2 05-18-2005 10:58 PM
user cant mount after chmod 777 /bin/mount misterwiddle Linux - General 2 04-06-2005 05:36 PM
User mount ?? exvor Linux - Software 8 11-13-2004 08:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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