[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] A question on Ownership
On Sat, Apr 13, 2002 at 02:49:03PM +0100, Ruth Gunstone wrote:
> A question on Ownership, Symlinks and my "Windows" drive:
>
> In my "Home" directory (/home/ruthie), I have created a symlink, called
> 'E-drive' to /mnt/win_e (which is a partition on my "Windows" hard-drive).
>
> The ownership of the Symlink was 'root'.
>
Ownership of the symlink does not matter.
> If I telnet from my 'other' computer, I can easily connect to my home
> directory, and from there, 'cd E-drive' and view all my files. However, if
> I'm logged-in as ruthie, I can't change any of these files as they appear to
> be owned by root (I thought 'Windows' had no concept of ownership?!). Nor can
> I create any files in this folder :-(
Windows does not, but you need to tell Linux what permissions to set when
it mounts the drive. These are given as options to the mount command.
E.G. My /etc/fstab has an entry for my Dos drive.
/dev/hda1 /dos/c vfat uid=0,gid=102,umask=007,noexec 0 0
/dev/hda1 is the device.
/dos/c is the mount point
vfat is the fs type
uid=0,gid=102,umask=007,noexec are the options.
uid=0 tells mount to set the owner of the files as root.
gid=102 tells mount to set the group of the files to group 102 (dos)
umask=007 is a bitmask. This is the inverse opposite of the permissions you
apply with chmod, so 007 tells it to give all permission (rwx) to owner
and group, but no permissions to world.
noexec tells the kernel not to execute files on this device.
This gives and ls -l example as
-rwxrwx--- 1 root dos 17858 Feb 17 09:52 scandisk.log
I then just add people who need access to the files to the dos group, and
bobs your uncle (don't forget to log out and log back in again for the
group membership change to take effect).
Setting the x permission is a bit silly, since I then mount the drive with
noexec, but this makes all the files in my dos partition show up a lovely
green colour in a directory listing. Just another reminder that I'm currently
in a dos drive.
Hope that helps.
--
Matthew Collins
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.