Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with NFS server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Iced-Tux
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 183
Location: Germany, Cologne

PostPosted: Fri Jan 19, 2007 5:18 pm    Post subject: Problem with NFS server Reply with quote

Hi all,
i have a litte problem.
I am trying to export my mp3 collection on my external USB-HDD which is mounted by IVMAN.

Code:

drwxrwx--- 8 ivman plugdev  16K  1. Jan 1970  usbext/


My export looks like this:
Code:
 cat /etc/exports
# /etc/exports: NFS file systems being exported.  See exports(5).
/media/usbext/Media 192.168.2.0/24(async,ro,no_subtree_check)


My problem is this:
I can mount the share BUT as the gid/ui for plugdev/ivman on my NFS-server are not the same as on my NFS-client
Code:
gid_server_plugdev != gid_client_plugdev and uid_server_ivman != uid_client_ivman
I can not access my files.

So my question is:
Are there any options to
* tell my NFS-server to export with different gid/uid
OR
* to mount on my client with different gid/uid.

Thx

iced-tux
_________________
!! The road to hell is full of good intentions !!
Back to top
View user's profile Send private message
chrbecke
Guru
Guru


Joined: 12 Jul 2004
Posts: 598
Location: Berlin - Germany

PostPosted: Fri Jan 19, 2007 5:46 pm    Post subject: Reply with quote

Have a look at man exports:

you have to specify the UID/GID of your user/group on the client system as anonuid and anongid parameters and the all_squash parameter in the servers /etc/exports.

HTH
Back to top
View user's profile Send private message
Iced-Tux
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 183
Location: Germany, Cologne

PostPosted: Fri Jan 19, 2007 6:19 pm    Post subject: Reply with quote

First of all, thx for your reply:
I tried to add the suggested opions:
Code:

cat /etc/exports
# /etc/exports: NFS file systems being exported.  See exports(5).
/media/usbext/Media 192.168.2.0/24(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000)


Nonetheless on the client gets the uid_ivman_server/gid_plugdev_ivman.

Any other suggestions?
_________________
!! The road to hell is full of good intentions !!
Back to top
View user's profile Send private message
chrbecke
Guru
Guru


Joined: 12 Jul 2004
Posts: 598
Location: Berlin - Germany

PostPosted: Fri Jan 19, 2007 6:27 pm    Post subject: Reply with quote

What's the output of
Code:
exportfs -v
on the server?
Back to top
View user's profile Send private message
Iced-Tux
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 183
Location: Germany, Cologne

PostPosted: Fri Jan 19, 2007 6:32 pm    Post subject: Reply with quote

Code:
exportfs -v
/media/usbext/Media
                192.168.2.0/24(ro,async,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1000,anongid=1000)

_________________
!! The road to hell is full of good intentions !!
Back to top
View user's profile Send private message
chrbecke
Guru
Guru


Joined: 12 Jul 2004
Posts: 598
Location: Berlin - Germany

PostPosted: Fri Jan 19, 2007 8:08 pm    Post subject: Reply with quote

That looks allright.

Setting anonuid and anongid in /etc/exports will not change the ownership of existing files/dirs on the share (it's not like the uid/gid mount option for vfat or ntfs - it just makes any remote access to files on the share appear to come from a user with uid/gid set to the values you specified with the anonuid/anongid options). But if you create new files/dirs on the share from the client, they will be owned by uid:gid you set in /etc/exports on the server. If you want the existing files to be owned by this uid:gid, you have to run
Code:
chown -R uid_on_client:gid_on_client /media/usbext/Media
on the server.

The exports manpage mentions a tool called rpc.ugidd which should do dynamic uid/gid mapping, which is probably what you want - but I couldn't find neither an ebuild nor sources for it on the web...

If you want the same uid/gid for your users all your systems, you could change uids/gids (if you've only got a few systems) or set up a NIS or LDAP server to manage user accounts (if you've got a larger network).

To change uids/gids, have a look at usermod and find, e.g.
find out the uid of user foo and gid of group foo:
Code:
id foo

(say foo's uid is aaa and foo's gid is bbb)
change uid/gid of user/group foo to new uid xxx and new gid yyy:
Code:
groupmod -g yyy foo
usermod -u xxx foo

find all files owned by uid aaa (foo's old uid) and change to the new uid:
Code:
find / -uid aaa -exec chown xxx {} ';'

Same for group foo:
Code:
find / -gid bbb -exec chgrp yyy {} ';'


HTH.
Back to top
View user's profile Send private message
Iced-Tux
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 183
Location: Germany, Cologne

PostPosted: Sat Jan 20, 2007 8:07 am    Post subject: Reply with quote

The problem is:
My USB-HDD is mounted by IVMAN. I COULD change the way ivman mounts the share, e.g. to my uid/gid. BUT other services also need to access these files, namely ftp, shoutcast and mpd, and I don't want to have these user/groups have access to anything else I own.
_________________
!! The road to hell is full of good intentions !!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum