[wellylug] mount partition as user (non-root) in gentoo

Jonathan Harker jharker at massey.ac.nz
Mon Mar 10 10:01:24 NZDT 2003


On Sunday 09 Mar 2003 10:30 pm, Ilia Pavlenko wrote:
> Greetings
>
> I've recently assembled a gentoo system, now when I tried to play with
> WINE (using windoze partition) I got problem:
>
> if I mount windows partition as root, and then try to use wine as user - i
> get bunch of "permission denied"-s.
>
> If I try to mount partition as user - I get "only root can do that".
>
> mount point /mnt/c has 777 permissions,
> /etc/fstab has this line for windows partition:
>
> /dev/hda2       /mnt/c    vfat     user,uid=1000,mode=777,codepage=866 0 0
>
> - same settings worked on my old system (LFS).
>
> What do I have to tweak in gentoo ?

You need the rw option, and you may have to fiddle with the umask, uid and gid 
options. My line in /etc/fstab is

/dev/hdg1 /mnt/stuff vfat 
rw,nosuid,noexec,nodev,umask=2,uid=root,gid=developers,user 0 0

You could also install and play with sudo. This allows you to run certain 
utilities with su permissions. Generally, for a user to execute commands on a 
host as a different user, the lines in /etc/sudoers look like this:

user    hosts = (as_user) commands

eg.

ilia    localhost = (root) /bin/mount /mnt/c, /bin/umount /mnt/c

you can set up aliases, eg.

COMMANDS = /bin/mount, /bin/umount, /usr/sbin/apachectl
POWERUSERS = ilia, bob, kate

POWERUSERS   localhost = (root) COMMANDS

This can be a bit unsafe though (you wouldn't want bob unmounting /usr, for 
example). If you trusted yourself, you could go

ilia  ALL = (ALL) ALL

But this defeats a whole bunch of security and gives hackers an extra path to 
root. Better practice to shell script common tasks (eg. mountcd, mountwin, 
etc) and setup a COMMANDS alias in sudo. Go man sudo and man sudoers for more 
info.

HTH
Jonathan

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/0XFolB/TM
---------------------------------------------------------------------~->

  .-.   Wellington
  /V\   Linux
 // \\  Users       
/(   )\ Group
 ^^-^^
        http://wlug.paradise.net.nz/

To unsubscribe from this group, send an email to:
wellylug-unsubscribe at egroups.com
  

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the wellylug mailing list