LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-18-2005, 04:53 PM   #1
jdupre
Member
 
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 36

Rep: Reputation: 15
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
 
Old 10-18-2005, 05:24 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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.
 
Old 10-18-2005, 05:34 PM   #3
baktor
LQ Newbie
 
Registered: Sep 2005
Location: Atlanta, GA USA
Posts: 17

Rep: Reputation: 0
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.
 
Old 10-18-2005, 06:09 PM   #4
jdupre
Member
 
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 36

Original Poster
Rep: Reputation: 15
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
 
Old 10-18-2005, 11:37 PM   #5
baktor
LQ Newbie
 
Registered: Sep 2005
Location: Atlanta, GA USA
Posts: 17

Rep: Reputation: 0
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.
 
Old 10-19-2005, 05:42 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Setup and use sudo..

No need to login as root, just sudo as you can even make it passwordless if you really want to..
 
Old 10-19-2005, 09:45 AM   #7
baktor
LQ Newbie
 
Registered: Sep 2005
Location: Atlanta, GA USA
Posts: 17

Rep: Reputation: 0
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.
 
Old 10-19-2005, 01:14 PM   #8
jdupre
Member
 
Registered: Sep 2003
Distribution: LFS6.1, FC3, RH9
Posts: 36

Original Poster
Rep: Reputation: 15
The sudo utility is sweet. Does what I want and more.
Thanks.
 
Old 02-04-2012, 10:03 AM   #9
flangemonkey
LQ Newbie
 
Registered: Aug 2007
Location: Newcastle UK
Distribution: Arch, Gentoo, Xubuntu
Posts: 11

Rep: Reputation: 0
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
can I mount two devices to the same mount point? gsgleason Linux - Hardware 7 03-04-2005 05:29 AM
give user access to mount xbriank Fedora 2 02-15-2005 06:44 PM
can a regular user mount devices ruwach Linux - Software 6 12-07-2004 12:40 PM
letting non-root users mount devices davey Linux - General 3 12-10-2003 06:09 AM
Multiple devices on the same mount point Knotz Linux - Hardware 3 05-15-2003 03:27 AM

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

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