Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rsync via nfs looses ownership for nobody:nobody
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
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Thu Dec 29, 2011 10:19 pm    Post subject: rsync via nfs looses ownership for nobody:nobody Reply with quote

Hi,
I want to perform backups via nfs. On the server, I set the /etc/exports like this :
Code:
/home/lalebarde   PCLALEBARDE(rw,sync,no_subtree_check,no_root_squash)

On the client, /etc/fstab :
Code:
PC2:/home/lalebarde     /PC2/backup/home/lalebarde   nfs   rw,auto,sync

Then I do the rsync from root in the client :
Code:
# rsync -a --delete /home/lalebarde/ /PC2/backup/home/lalebarde/

As the result, all files in the backup are set user=nobody, group=nobody.
I thought from what I read on the web that no_root_squash was the key, but no. Of course, I reloaded the nfs server when I changed the exports. I also have the same users and groups, UIDs & GIDs.

Any clue ?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Dec 30, 2011 12:08 am    Post subject: Reply with quote

Methinks everything falls into place when you have user lalebarde in remote machine with same UID as in your local machine. And no_root_squash is really not a feasible option, I use portage on NFS for instance and it is owned by user portage:portage in remote box which is even not running Linux. Just do your backups as user and everything will be fine.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Fri Dec 30, 2011 9:17 am    Post subject: Reply with quote

Thanks for your answer Jaglover.

Jaglover wrote:
Methinks everything falls into place when you have user lalebarde in remote machine with same UID as in your local machine.
That's what I do have.

Jaglover wrote:
Just do your backups as user and everything will be fine.
It is not a solution for me since my directories belong to several groups, depending on what I want to share with whom.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Dec 30, 2011 12:25 pm    Post subject: Reply with quote

Shouldn't all rights be preserved if you have same groups (with same GID) in the remote box?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7471

PostPosted: Fri Dec 30, 2011 3:51 pm    Post subject: Reply with quote

if your user is root and you end with uid:gid of nobody, it's exactly what the root_squash should do.
your export is then not understood as you think.

you might try exportfs -v on server to see what options are set the way you think they should.

and you might check your server for which version of nfs you are using on server and client to mount the share, for a nfsv4 server this is not a valid export directive, as you should have a root directory with fsid=0 and subdirectories directives.
for some obscure reasons i really don't know why, let's say compatibilities, they accept nfsv3 style of exports and the server try to use that for both v3 and v4, this cause more troubles then help, as a v3 client will mount it right, but a v4 will find it totally wreck as non-standard to v4.

what you could try, is forcing the client to use v3, i think it's with -o nfsver=3 parameter, this "should" gave you a more permissive nfs server.
you could lower your security too by passing the group uid you wish to your export filesystem with anongid=guidyouwish to let your root_squashing setting the guid you wish instead of the default nobody guid
or switch to full nfsv4 with your clients and server configure to use idmapd with the same domain.
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