mount device as user

Hello.
My quiestion is prety basic, but i dont have a solution in google or handbook.

I created a new dir named /pen and I edited the fstab to add a pendrive:
(/dev/da0 /pen msdosfs rw 0 0)

I can mount that as a root and I can read and write it.

The questions are:

1)How should I do to mount/unmount devices as a normal user (but not use the command sudo, I need to do "mount /pen" as a normal user, not "sudo mount /pen)

2)How should I do to write in the pendrive as a normal user (I try to write to it when the pendrive is mounted as "sudo mount /pen" but I cant write)

Thanks!
 
add to your /etc/sysctl.conf
Code:
vfs.usermount=1

and add something like this to your /etc/devfs.rules
Code:
[localrules=10]
add path 'da*' mode 0660 group users
add path 'md*' mode 0660 group users

and add

Code:
devfs_system_ruleset="localrules"
to /etc/rc.conf


In example above users in group users will be able to mount flash and virtual disks on directories they own (~/mnt for example)


also modify your /etc/devfs.conf
Code:
own     acd0    root:users
perm    acd0    0660
this will allow users in group users to mount /dev/acd0 which usually is cd/dvd-rom
 
Back
Top