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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-18-2005, 04:53 PM
|
#1
|
|
Member
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 32
Rep:
|
How to give not-root user ability to mount devices to any mount point???
How do I allow any user or specific users to mount specific devices at a mount point they specify?
I see that fstab can be edited with an entry like so:
/dev/fd0 /media/floppy auto user,noauto
That would allow any user to
# mount /dev/fd0
and have it be mounted to /media/floppy
But if the user tried
# mount /dev/fd0 ~/mymounts/floppy
The mount would fail. The entry in fstab limits the mount to the mount point specified.
Specifically I need to be able to allow non-root users the ability to mount filesystems using the loop feature, as in
# mount -o loop some.fs.image /some/mount/point
Even if the user has read/write access to the /dev/loop(n) device nodes, it appears only root can mount. It seems to me that if a user has read/write access to a device, and read/write access to a mount point, they should be able to use mount regardless of what it says in fstab.
- Joe
|
|
|
|
10-18-2005, 05:24 PM
|
#2
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
If you REALLY require this feature you could
add a line per user into /etc/fstab, and tell them
to mount the devices not using the /dev entry
but rather the mountpoint to execute it, e.g.
mount ~/mymounts/floppy
Cheers,
Tink
P.S.: I don't think that rw to a loop from several mountpoints
would be a good idea.
Last edited by Tinkster; 10-18-2005 at 05:25 PM.
|
|
|
|
10-18-2005, 05:34 PM
|
#3
|
|
LQ Newbie
Registered: Sep 2005
Location: Atlanta, GA USA
Posts: 17
Rep:
|
jdupre, this is a very very bad idea. Let's say you give me rights to use mount and allow me to mount .iso's via loop to any directory that I can write to. (phrasing what you mention at the start of the thread). This is _ASKING_ to be hacked. All I would need to do is upload an .iso image of whatever I wanted...say my own personal executables that I built on my personal server. I could then mount that iso in say, /var. Suddenly I have all the programs/files in that iso at my disposal.
Might not sound like much, but if the user can write to /etc, that means with 1 .iso, I can overmap your /etc to be my /etc...which I know the root password for and have different config files for. Boom, your machine is mine.
This is just a taste of why mount is a root only program and why it is STRONGLY discouraged to do exactly what you are trying to do. Please take my post seriously and try to think of another idea for your problem. I would hate to hear later your machine has been hijacked or worse.
|
|
|
|
10-18-2005, 06:09 PM
|
#4
|
|
Member
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 32
Original Poster
Rep:
|
Thanks for the advices. My requirements are that of a developer, not a system administrator. This is not a public machine, and "root" and myself are the only users on the system. I just hate having to su all the time just to mount/umount a filesystem I happen to be working on at the moment. (I am working with filesystem images that I mount as a loop device.) Apparently this can only be done as root.
I thought that by simply adding myself to the group that owns the /dev/loop devices I could overcome this limitation of mount.
Of course I could just always login as root, but that has it's drawbacks as well!
- Joe
|
|
|
|
10-18-2005, 11:37 PM
|
#5
|
|
LQ Newbie
Registered: Sep 2005
Location: Atlanta, GA USA
Posts: 17
Rep:
|
I'd rather say you should setup a line in your /etc/fstab for the images. I am setup much like how your setup. I typically have 1 console window that's left logged in as root. Yes, bad. Yes, convenient.
|
|
|
|
10-19-2005, 05:42 AM
|
#6
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Setup and use sudo..
No need to login as root, just sudo as you can even make it passwordless if you really want to..
|
|
|
|
10-19-2005, 09:45 AM
|
#7
|
|
LQ Newbie
Registered: Sep 2005
Location: Atlanta, GA USA
Posts: 17
Rep:
|
May want to look into the automounter as well. It's a little work to configure, but it may be a slick solution for your problem as well.
|
|
|
|
10-19-2005, 01:14 PM
|
#8
|
|
Member
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 32
Original Poster
Rep:
|
The sudo utility is sweet. Does what I want and more.
Thanks.
|
|
|
|
02-04-2012, 10:03 AM
|
#9
|
|
LQ Newbie
Registered: Aug 2007
Location: Newcastle UK
Distribution: Xubuntu
Posts: 2
Rep:
|
an alternative for others reading this now is fuseriso, although I am still fighting with getting the fuse system to recognise it in my kernel... 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:51 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|