rsyncing feeling

daniel danstemporaryaccount-FFYn/CNdgSA at public.gmane.org
Wed Jul 21 23:50:00 UTC 2004


On July 21, 2004 08:16 pm, David J Patrick wrote:
> rsync !
> Just what I need to keep my USB-key files in sync with the laptop and
> the desktop.
> But what's this ? A fly in my ointment ! A big hairy one !
> It's name is "permissions"; I have no idea how to reconcile files for
> users of multiple systems.
> It seems not to be enough that "dave" is the log-in name on all
> machines, or that he is a member of the "office" group. I know this must
> be absurdly simple, and long dealt with, un unix days of old. but, once
> again, I could use a clue.
> thank you,
> djp

you're right, the problem is very old, and not as easily solved without 
complication.  see, the problem you're (probably) having is that user "dave" 
is UID 1000 on one box, and say, UID 1002 on another.  redhat machines start 
their new users at UID 500, so that can lead to issues accross linuxes.

linux doesn't care what name you give yourself.  it only cares what number you 
are, so that's why these UID's are so important.  if you want to know what 
your UID is, just do this:

  dave at localhost $ echo $UID

and you'll get some number.  now, if you want files saved with "dave" as the 
user to be owned by "dave" on another box, you have to change the UIDs on the 
appropriate machines.  that value is in /etc/passwd and is relatively easy to 
switch over as long as it's not a multi-user system where someone else 
already has your id...  then things get ugly.

in the case of this ugliness, you might have to look at NIS (look it up on the 
linux documentation project) or, probably easier, a simple script that 
updates all the file ownerships upon transfer.  something like this:


  find <path> -uid 500 -print0 | xargs -0 --replace chown dave:users {}

i think that'd work, but i haven't tried it.  rtfm and good luck ;-)

-- 
"We cannot let terrorists and rogue nations hold this nation hostile or hold
our allies hostile."

George W. Bush
August 21, 2000
Comments from a campaign speech delivered in Des Moines, Iowa.
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list