[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mount -o remount,rw as user



HI,

> On a mostly Etch system with this line in /etc/fstab
>    /dev/hda5     /d    msdos   defaults,rw,user,umask=0001      0 0
> user mike can mount the partition and write to it but not remount it
> read only in any way I can discover.

to make the partition mounted readonly, simply change rw (read write) to ro (read only) in the fstab row:
   /dev/hda5     /d    msdos   defaults,ro,users,umask=0001     0 0

> mike@/deb40:~> mount -o remount,ro /d
> mount: only root can do that

for this issue you can use sudo (for more info: # man sudoers).
For example, your sudoers file could be:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults    env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias    MOUNT = /bin/mount
Cmnd_Alias    UMOUNT = /bin/umount

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

mike ALL = NOPASSWD: MOUNT, UMOUNT
 


But in this case mike will be able to use mount for any partition.
 
Hope this helps you.


Reply to: