[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rsync and Windows backups on a Debian box and permissions



George Randall wrote:
> H.S. wrote:
>> Hello,
>>
>> I have a Debian box (running Testing) which rsyncs some directories from
>> a Windows laptop (running XP on an ntfs partition) to a partition on a
>> local disk on the Debian box.
>>
>> The Debian box uses rsync via ssh connection made with the XP box which
>> has cygwin and ssh server installed. The user used to do the ssh
>> connection is an administrator on the XP box ('root'). The script is
>> running from the root account on the Debian box.
<SNIP>
>> Now, this all works very well for making the backups.
>>
>> However, the permissions of the files pulled from the XP box to the
>> Debian box are the same as on the XP box. The same two users, user1 and
>> user2, also exist on the Debian box. However, the gids and uids of these
>> users are different on the XP box and on the Debian box. So the users
>> cannot browse their own directories (backups) from within the Debian box
>> (permissions denied).
>>
>> This is a problem if a user wants to browse, or recover files from, his
>> backups by connecting from the XP box to the Debian box using ssh
>> (because then the user's gid and uid are Debian numbers, not the XP, or
>> cygwin on XP, numbers).
>>
>> Any ideas how I get around this problem?
>>
>> Thanks.
> 
> Couldn't you add at the end of the script to chown the directories to
> the proper owners?
> 

I was thinking on the same lines. Changing the owner using the uid
should work.

I am still in the process of building this script. I am going to add
other XP directories as well that will be backed up. I am not sure how
the permissions in Windows really work as far as ownership is concerned.
If a user1's directory has some file owned by another user but readable
by user1, I would want to preserve that ownership.

Further, I would also need to get the uid's of the users involved. I
would prefer it to be automatic (in case I add more users to be backed
up). Perhaps ssh can be used in some way to get this information from
the Windows machine.

Finally, this just occured to me, perhaps it is possible the uid's and
gid'd see by the Debian machine in the XP machine are created by cygwin?
I am not sure. If this is case, I could modify the account information
in Cygwin to reflect the number scheme use din Debian (I think Cygwin
uses gid and uid numbers scheme from Redhat).

Thanks.


-- 

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.


Reply to: