View previous topic :: View next topic |
Author |
Message |
LostInGentoo Apprentice
Joined: 27 Jun 2002 Posts: 269 Location: Denmark
|
Posted: Sat Apr 10, 2004 11:34 am Post subject: User to mount /dev/cdrom |
|
|
Hi there
I wonder how to let the normal user in the users-group be able to mount specific mount points?
F.x. I wanna let others mount /mnt/cdrom without being root!
Thanks for helping |
|
Back to top |
|
|
ferrarif5 Apprentice
Joined: 06 Sep 2003 Posts: 211 Location: Manchester, UK
|
Posted: Sat Apr 10, 2004 11:39 am Post subject: |
|
|
Place "user" in the options for fstab e.g
Code: | /dev/cdroms/cdrom0 /mntcdrom iso9660 noauto,ro,user 0 0 |
_________________ Asus P6X58D-E Mobo
Intel Core i7 920
18GB Corsair DDR3
User:335876 | Screenshot |
|
Back to top |
|
|
mattjgalloway l33t
Joined: 16 Mar 2004 Posts: 761 Location: Coventry, UK
|
Posted: Sat Apr 10, 2004 11:39 am Post subject: |
|
|
In /etc/fstab add 'user' to the options part of the line where your cd drive(s) is listed.
EDIT: Sorry, we must have cross posted. _________________ AMD64 3200+, 1024MB RAM, Gentoo Linux
MacBook Core Duo, 1024MB RAM, Leopard
Last edited by mattjgalloway on Sat Apr 10, 2004 12:42 pm; edited 1 time in total |
|
Back to top |
|
|
joem Retired Dev
Joined: 20 Dec 2002 Posts: 508 Location: Bloomington, In
|
Posted: Sat Apr 10, 2004 11:40 am Post subject: |
|
|
Make sure you have "users" as an option in /etc/fstab.
Code: | /dev/cdroms/cdrom1 /mnt/cdrom iso9660 noauto,ro,users 0 0 |
That would be an example |
|
Back to top |
|
|
LostInGentoo Apprentice
Joined: 27 Jun 2002 Posts: 269 Location: Denmark
|
Posted: Sat Apr 10, 2004 1:29 pm Post subject: |
|
|
Is it a keyword or the name of the group that should be placed there? |
|
Back to top |
|
|
ozonator Guru
Joined: 11 Jun 2003 Posts: 591 Location: Ontario, Canada
|
Posted: Sat Apr 10, 2004 2:23 pm Post subject: |
|
|
LostInGentoo wrote: | Is it a keyword or the name of the group that should be placed there? |
It's a keyword. For a full description, see the man page for 'mount', in particular the section for '-o' (options). |
|
Back to top |
|
|
mattjgalloway l33t
Joined: 16 Mar 2004 Posts: 761 Location: Coventry, UK
|
Posted: Sat Apr 10, 2004 2:40 pm Post subject: |
|
|
By the way:
dst wrote: | Code: | /dev/cdroms/cdrom1 /mnt/cdrom iso9660 noauto,ro,users 0 0 |
|
Is wrong. 'ro' means root only, then the next command, 'users', won't do a lot. It should be 'user' and have no 'ro'. Also, 'auto' instead of 'iso9660' is a good idea. _________________ AMD64 3200+, 1024MB RAM, Gentoo Linux
MacBook Core Duo, 1024MB RAM, Leopard |
|
Back to top |
|
|
joem Retired Dev
Joined: 20 Dec 2002 Posts: 508 Location: Bloomington, In
|
Posted: Sat Apr 10, 2004 3:04 pm Post subject: |
|
|
mattjgalloway wrote: | By the way:
dst wrote: | Code: | /dev/cdroms/cdrom1 /mnt/cdrom iso9660 noauto,ro,users 0 0 |
|
Is wrong. 'ro' means root only, then the next command, 'users', won't do a lot. It should be 'user' and have no 'ro'. Also, 'auto' instead of 'iso9660' is a good idea. |
by the way:
ro is read only and users allows every user to mount and unmount. User will write the name of the user that mounted the fs to mtab so they are allowed to unmount it again. Useres allows everybody to monut and unmount. Don't reply to threads correcting people (especially in threads where a user is looking to gain information on something they don't know anything about) when you don't really know what you are talking about |
|
Back to top |
|
|
hermes_jr l33t
Joined: 26 Feb 2004 Posts: 701 Location: Moscow, Russia
|
Posted: Sat Apr 10, 2004 10:05 pm Post subject: |
|
|
Here's a part of my fstab:
fstab wrote: |
/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,ro,user 0 0
/dev/fd0 /mnt/floppy auto noauto,user 0 0
|
Now. If I'm trying this as user: # mount /dev/fd0 <- floppy mounts, if I'm trying this: # mount /mnt/floppy <- floppy mounts... BUT if I'm trying this: # mount /dev/fd0 /mnt/floppy <- "only root can do that" message appears!
Can someone explain me this strange thing?
[edit]: sorry, I mispelled... here's an output, no extra space:
Quote: |
$ mount /dev/fd0 /mnt/floppy/
mount: only root can do that
|
Last edited by hermes_jr on Sat Apr 10, 2004 10:35 pm; edited 1 time in total |
|
Back to top |
|
|
smiley Tux's lil' helper
Joined: 03 Dec 2003 Posts: 127
|
Posted: Sat Apr 10, 2004 10:20 pm Post subject: |
|
|
Quote: | # mount /dev/fd0 /mnt floppy |
my guess is that is trying to mount /dev/fd0 to /mnt, because you have a space between /mnt and floppy. And because fstab doesn't have an entry about mounting /dev/fd0 to /mnt, only root can do it. (Of course, you probably shouldn't mount directly onto /mnt anyway; or was that just a typo?)
smiley
EDIT: Oops, I should have assumed that it was, indeed, a typo.
Last edited by smiley on Sat Apr 10, 2004 10:49 pm; edited 1 time in total |
|
Back to top |
|
|
ozonator Guru
Joined: 11 Jun 2003 Posts: 591 Location: Ontario, Canada
|
Posted: Sat Apr 10, 2004 10:43 pm Post subject: |
|
|
smiley wrote: | Quote: | # mount /dev/fd0 /mnt floppy |
my guess is that is trying to mount /dev/fd0 to /mnt, because you have a space between /mnt and floppy. And because fstab doesn't have an entry about mounting /dev/fd0 to /mnt, only root can do it. (Of course, you probably shouldn't mount directly onto /mnt anyway; or was that just a typo?)
smiley |
In my experience, doing "mount /mntpoint" when /mntpoint has a corresponding entry with the 'user' option in fstab does indeed work as a normal user, but "mount /device /mntpoint" doesn't, and gives the 'you must be root' error. I'm not exactly sure why, but I suspect it's because mount with one argument checks fstab, including whether or not the 'user' option is set, while mount with two arguments just tries to do the mount without checking fstab (or at least before checking fstab), and that can only be done by root. This is just a hunch, though; the man page for mount discusses how it uses fstab, which is in a way that's consistent with my theory, but it doesn't cover exactly the case that hermes_jr raises. |
|
Back to top |
|
|
rwfranz n00b
Joined: 09 Feb 2004 Posts: 14
|
Posted: Tue Apr 20, 2004 9:08 pm Post subject: |
|
|
ozonator wrote: | smiley wrote: | Quote: | # mount /dev/fd0 /mnt floppy |
my guess is that is trying to mount /dev/fd0 to /mnt, because you have a space between /mnt and floppy. And because fstab doesn't have an entry about mounting /dev/fd0 to /mnt, only root can do it. (Of course, you probably shouldn't mount directly onto /mnt anyway; or was that just a typo?)
smiley |
In my experience, doing "mount /mntpoint" when /mntpoint has a corresponding entry with the 'user' option in fstab does indeed work as a normal user, but "mount /device /mntpoint" doesn't, and gives the 'you must be root' error. I'm not exactly sure why, but I suspect it's because mount with one argument checks fstab, including whether or not the 'user' option is set, while mount with two arguments just tries to do the mount without checking fstab (or at least before checking fstab), and that can only be done by root. |
I don't think so. I've been experiencing this same problem, described below:
As root, I can mount /dev/sda1 (a USB HD) onto /usb using "mount /usb". The users can access the device and write to it (because fstab contains 'umask=0000' for that device). However, even though the fstab line contains "users", only root can mount the device. Error message received: "only superuser can use mount". I've tried changing permissions on /bin/mount, but that doesn't change the behavior.
Setting "owner" as an option doesn't change the behavior either.
Now, I can do "su -c 'mount /usb'" and it will work... but since others report users as being able to do this mount stuff, I figure the thing's not quite tweaked yet until I can make that happen.
Any clues appreciated. _________________ Live large. |
|
Back to top |
|
|
ozonator Guru
Joined: 11 Jun 2003 Posts: 591 Location: Ontario, Canada
|
Posted: Tue Apr 20, 2004 9:26 pm Post subject: |
|
|
rwfranz wrote: | even though the fstab line contains "users", only root can mount the device |
Is that a typo? It should be 'user', not 'users'.
One other thought: what are the permissions on the device you're trying to mount? If the /dev/sda1 device (or whatever it points to) has permissions that deny access to the user that's trying to mount it, then that user can't mount it, no matter what settings are in fstab. In that case, assuming you're using devfsd, adjusting devfsd settings for that device might do the trick. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|