Happy holidays everyone.
I wonder if someone can help me, I have a non-super user on my box which I’d like to give it MOUNT and UMOUNT permissions but I don’t know how.
For example purposes, the user name is “USER”.
I don’t want to make it into a SuperUser, just give it rights to be able to issue the MOUNT and UMOUNT commands at the terminal.
You can do this with the sudo command. Run the following for the basic info:
man sudo
man sudoers
Basically you add an entry into /etc/sudoers to allow someuser to run the
/bin/mount and /bin/umount commands as root. Once done they can do
anything with the mount command as ‘root’ (including unounting things you
may like left alone) so be careful.
Searching for ‘sudoers example mount’ (without quotes) using Google turned
up some good stuff too.
Good luck.
badger fruit wrote:
> Happy holidays everyone.
> I wonder if someone can help me, I have a non-super user on my box
> which I’d like to give it MOUNT and UMOUNT permissions but I don’t know
> how.
>
> For example purposes, the user name is “USER”.
> I don’t want to make it into a SuperUser, just give it rights to be
> able to issue the MOUNT and UMOUNT commands at the terminal.
>
> Thanks for reading and any replies!
> Rich
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
In addition to what ab said, you can also add the ‘user’ option to the partition in /etc/fstab. This will allow a regular user to mount/unmount that partition, though it will allow any regular user to mount it so if you only look into restricting the mount stuff to only one specific user, then ab’s solution will be preferable.
There are two user-mount options for mounting; user and users
The first allows regular users to mount the parition and only the user who mounted it, will be able to unmount it again, ie if another regular user tries to unmount it, he won’t succeed
The second option (users) allows any regular user to mount and unmount the partition, ie if user ‘a’ mounts the partition, then user ‘b’ is allowed to unmount it… something not possible/allowed with the first ‘user’ option
Also that is limited to mounts explicitly defined in /etc/fstab, I believe
(correct me if I’m wrong). If you wanted to mount an ISO for the first
time today there would be no way unless you had a way to modify /etc/fstab
for every ISO ever mounted.
Good luck.
microchip8 wrote:
> In addition to what ab said, you can also add the ‘user’ option to the
> partition in /etc/fstab. This will allow a regular user to mount/unmount
> that partition, though it will allow any regular user to mount it so if
> you only look into restricting the mount stuff to only one specific
> user, then ab’s solution will be preferable.
>
> There are two user-mount options for mounting; user and users
>
> The first allows regular users to mount the parition and only the user
> who mounted it, will be able to unmount it again, ie if another regular
> user tries to unmount it, he won’t succeed
>
> The second option (users) allows any regular user to mount and
> unmount the partition, ie if user ‘a’ mounts the partition, then user
> ‘b’ is allowed to unmount it… something not possible/allowed with the
> first ‘user’ option
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
Another option may be to have one mountpoint defined and allowed for users
and have the “file” be a symlink which the user can control themselves…
for example, /home/username/someiso which points to
/home/username/whatever0 or /home/username/whatever1. With that done the
user could then unmount, point the symlink to a new ISO file, then mount
again. Otherwise use sudo or explicitly define the mountpoints as you
mentioned.
Good luck.
microchip8 wrote:
> ab@novell.com;2094607 Wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Also that is limited to mounts explicitly defined in /etc/fstab, I
>> believe
>> (correct me if I’m wrong). If you wanted to mount an ISO for the first
>> time today there would be no way unless you had a way to modify
>> /etc/fstab
>> for every ISO ever mounted.
>>
>> Good luck.
>>
>
> yeah, for ISOs you’d need to be root to mount them on a loop device or
> add entries to fstab
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
If you wish to use the sudo solution, easiest to use the YaST Sudo module. The sudoers file has specific syntax and formatting requirements. There is a command line program which enforces this notation, but YaST is friendlier. Remember to use the fully-qualified program filename (/bin/mount and /bin/umount).