LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-08-2016, 06:16 PM   #16
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465

You need to run the command as root. If you do it with any other person, all files will be created with that account. Only root has the ability to change the ownership of a file.
 
Old 09-08-2016, 06:20 PM   #17
lq_win
Member
 
Registered: Jul 2015
Posts: 64

Original Poster
Rep: Reputation: Disabled
I ran it using root.
 
Old 09-08-2016, 07:02 PM   #18
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
What is the destination file system? Is it a network file share of some sort? Depending on the destination file system and possibly folder settings, there may be something that is overriding root's normal local capabilities.

For example, if you are using sshfs, the abilities will be limited to the abilities of the login used to mount the share.
 
Old 09-08-2016, 07:43 PM   #19
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Something curiously maps ownership in your target directory to the guest user...
Could you tell more about target directory, is it a mounted directory from network, if yes what protocol?

edit, yes as @IsaacKuo says... Sorry didn't read the posts on page 2

Last edited by keefaz; 09-08-2016 at 07:45 PM.
 
Old 09-08-2016, 08:28 PM   #20
lq_win
Member
 
Registered: Jul 2015
Posts: 64

Original Poster
Rep: Reputation: Disabled
Hello All,

The problem is resolved now..
rsync -rtvua /home2/user1/ /home3/user1.backup
I made something stupid there .. (sorry .. to make all of you confusing)

thanks...

but now I want to rsync /home3/user1/backup to another server via ssh..
ssh-keygen was created and I was able to login

I ran command below:

rsync -rtvua /home3/user1.backup guest@backup.mydomain.co.id:/backup/VIP/10.100.100.50

all ownership become 'guest' ?

what I missed?
 
Old 09-08-2016, 08:44 PM   #21
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by lq_win View Post
rsync -rtvua /home3/user1.backup guest@backup.mydomain.co.id:/backup/VIP/10.100.100.50

all ownership become 'guest' ?

what I missed?
As already noted, if you use a regular user, such as guest, all files created will be owned by that user. Root is the only user which can change ownership of a file.

Your command explicitly uses the userid "guest" to log into backup.mydomain.co.id.
 
Old 09-08-2016, 09:12 PM   #22
lq_win
Member
 
Registered: Jul 2015
Posts: 64

Original Poster
Rep: Reputation: Disabled
Hi IsaacKuo,

you are right!..

if I tried to rsync specific user it run correctly (the ownership preserved)

rsync -rtvuaz /home3/user1.backup root@backup.mydomain.co.id:/backup/VIP/10.100.100.50 --> this will preserved ownership for user1

but if I run:

rsync -rtvuaz /home3 root@backup.mydomain.co.id:/backup/VIP/10.100.100.50 --> all folders owned by root..
or
rsync -rtvuaz /home3/* root@backup.mydomain.co.id:/backup/VIP/10.100.100.50 --> all folders owned by root..

what wrong?
 
Old 09-08-2016, 10:14 PM   #23
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Did you get any error messages?
 
Old 09-09-2016, 10:17 AM   #24
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Do you know for sure which remote shell the rsync command is using? I personally do not use rsync in this fashion, so I can't be certain ... I think by default the way you state it an unencrypted connection is used. Probably not a good idea, since I'm guessing this data is being transferred over the internet (as you seem to be using a fully qualified domain name).

In any case, the remote shell you are using may not be properly configured to provide root with full access rights. The usual thing, I think, is to use "-e ssh" to specify ssh shell - for the sake of encryption and security. You'll have to configure ssh to allow root login, of course, and for security's sake you'll likely want to disallow password login (only allowing key based authentication).

Finally, it is still possible there is something funny about the destination file system or parent folder properties. You have not said anything about the destination file system or the parent folder properties yet.
 
Old 09-09-2016, 10:26 AM   #25
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by IsaacKuo View Post
Do you know for sure which remote shell the rsync command is using? I personally do not use rsync in this fashion, so I can't be certain ... I think by default the way you state it an unencrypted connection is used. Probably not a good idea, since I'm guessing this data is being transferred over the internet (as you seem to be using a fully qualified domain name).

In any case, the remote shell you are using may not be properly configured to provide root with full access rights. The usual thing, I think, is to use "-e ssh" to specify ssh shell - for the sake of encryption and security. You'll have to configure ssh to allow root login, of course, and for security's sake you'll likely want to disallow password login (only allowing key based authentication).

Finally, it is still possible there is something funny about the destination file system or parent folder properties. You have not said anything about the destination file system or the parent folder properties yet.
rsync uses ssh by default, "-e ssh" is redundant.
 
1 members found this post helpful.
Old 09-09-2016, 05:54 PM   #26
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
# rsync -aRXHv ./* /mnt/clone/

When I'm cloning a linux install (that's not currently being used). While in the / of the install to be cloned. $(cd /mnt/original/)
 
  


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
rsync - permission denied (13) on Centos 6.5 - even when run as root Kernel Fergus Linux - Server 3 03-06-2014 09:54 AM
File & Folder Permission and Ownership permission error in Cloud storage. rhcekumaran Linux - Newbie 3 06-14-2013 04:41 AM
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
rsync not preserving owner and group graziano1968 Linux - Server 6 09-10-2008 07:52 AM
Preserving date and ownership when untar ? talat Linux - Software 1 02-09-2006 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:51 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