LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-28-2004, 05:25 PM   #1
gkneller
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: Slackware & Debian
Posts: 27

Rep: Reputation: 15
Does anyone know why mounting NFS shares causes the directory permissions to change?


Hi everybody, first post. Nice to meet you all!

I've got the NFS server running on Debian 3.0r1, and I'm accessing the share from another PC running Slackware 9.1. Everything works the way it should (that is, I can access all the files on the share the way I want to), apart from this weird quirk which I'm hoping someone might be able to shed some light on.

These are the permissions for my /mnt directory on the Slackware box before the NFS share is mounted:

drwxr-xr-x 2 root root cdrw
drwxrwxr-x 6 root users drivers
drwxr-xr-x 2 root root dvd
drwxr-xr-x 2 root root floppy
drwxr-xr-x 2 root root nfs
drwxrwxr-x 7 root users windows

'drivers' and 'windows' are where separate FAT32 partitions are mounted, but the others are just normal directories. This is what the permissions look like after the share is mounted:

drwxr-xr-x 2 root root cdrw
drwxrwxr-x 6 root users drivers
drwxr-xr-x 2 root root dvd
drwxr-xr-x 2 root root floppy
drwxrwsr-x 4 root ftp nfs
drwxrwxr-x 7 root users windows

What's going on here? You can't change the umask in fstab the way you can with the Windows partitions, and I've tried such a large variety of the options set out in the exports, mount and nfs man pages that I can feel my brain turning into jelly . The line in fstab at the moment is just this:

debian:/home /mnt/nfs nfs noauto,user 0 0

I'm hoping it's just some simple thing that I've overlooked. Does anyone have any ideas?
 
Old 01-28-2004, 11:37 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
For linux type partitions, If you want to change the owner, group (chown owner:group /mnt/nfs), or permissions of the file system, you do so after mounting the partition. For other file systems such as vfat or smbfs, you need to add a gid= or uid= option in the /etc/fstab entry.
Look at the man pages for the mount command. Different filesystems use different options.
 
Old 01-29-2004, 07:43 AM   #3
gkneller
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: Slackware & Debian
Posts: 27

Original Poster
Rep: Reputation: 15
Already tried it - doesn't work. Won't let you change permissions while the share is mounted, and if you unmount, chown/chmod and remount they just go right back to what they were. As I said, I've tried most of the general and nfs-specific commands in the mount man page - no joy.
 
Old 01-29-2004, 08:00 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
when you mount the partition is should be assuming the permissions set for the remote share. it's not using /mnt/nfs as a normal directory, but as a mount point, so will change the shares and such. you should find that the permissions it changes to match that of the remote server
 
Old 01-29-2004, 09:21 AM   #5
gkneller
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: Slackware & Debian
Posts: 27

Original Poster
Rep: Reputation: 15
Done it - thanks acid, that really helped.

This is what was confusing me:

On my Debian machine, /home was owned by root staff. The gid of 'staff' is 50. I had originally discounted the possibility of the permissions for the remote share overriding those of the mount point because there's no 'ftp' group on the Debian box. But guess what? A closer look in /etc/group on Slackware revealed that the gid of 'ftp' is... 50. So NFS is mapping the not only the directory permissions of the share, but also the user and group ids of the owners. Now I start to realise why NFS is regarded as being so insecure...

Last edited by gkneller; 01-29-2004 at 09:22 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting NFS Shares ... UID Problem Riddick Linux - Software 1 01-06-2005 10:48 AM
mounting NFS shares help pls mlu Linux - Networking 1 11-23-2004 10:32 PM
Conditionally mounting nfs shares eagle862 Linux - Networking 1 11-03-2004 12:46 AM
exporting NFS shares in redhat 9 / mounting them in OS X 10.2.6 brainlego Linux - Networking 7 07-25-2003 07:46 AM
Support for mounting NFS shares glock19 Linux - General 1 05-09-2002 08:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration