rsync and ssh keys help

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
# 1  
rsync and ssh keys help

Not specifically a mac question, but it's what I am using.

I am setting up some replication for some file shares using rsync. The problem is that I am being given a little bit of a twist - I'm supposed to use a non-admin account to do it with.

I have 2 boxes - Master and Slave with 1 account (sharesync). I setup a pub/private key pair and am able to successfully ssh from slave to master. I can also run rsync from the slave to the master. My problem is that rsync fails, complaining that it can't change ownership/permissions on the files that it just placed on the slave. This makes sense in that it requires admin rights to be able to chown files.

Is there a way to allow the non-admin sharesync account to rsync files? Or do I just tell the guy that we will do it the old fashioned way - using a root/admin account?

This works, by running it out of an admin account, but does not work with the sharesync key pair:
sudo -u sharesync /usr/bin/rsync -ahvv --delete --log-file=/Users/Shared/$(date +%Y%m%d)rsynclog_nosudo.txt /Volumes/Data/Shares/CasperShare/

This works with the ssh key pair, but fails when rsync tries to change ownership and set times:
/usr/bin/rsync -ahvv --delete --log-file=/Users/Shared/$(date +%Y%m%d)rsynclog_nosudo.txt /Volumes/Data/Shares/CasperShare/
sent 127.34K bytes  received 22.65M bytes  15.19M bytes/sec
total size is 109.88G  speedup is 4823.39
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(1400) [generator=2.6.9]

# 2  

Check the user and folder permissions for this folder "/Volumes/X2_Data/Shares/CasperShare" .You cant copy when there is no permission for others.By changing the permission of the source you will be able to do rsync.
# 3  
-a equals -rlptgoD, which includes changing perms, owner and group. Use -rlpt instead. (omitting -g = preserve group, -o preserve owner, -D sync devices and special files)
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #277
Difficulty: Easy
Solaris is a version of UNIX System V Release 4 (SVR4), jointly developed by Sun and AT&T, and was licensed by Sun from DEC to replace SunOS.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. Red Hat

Configuring the SSH keys..

I am currently working on setting up a server to scp some files over for backup purposes. Server 1 - Bob (Appliance) Server 2 - Sana (RH 5) Server 1 - 1 - Generated RSA2 2 - Collected the public key to be input on the backup server = Sana Server 2 - 1 - This is were I am stuck the... (4 Replies)
Discussion started by: NelsonC
4 Replies

3. Solaris

help with SSH keys

Hello, I could use some help with my ssh keys and agent. This is the issue. I have 2 different UNIX systems at work. One is the normal Solaris servers with my uid being the same throughout all the servers. I now have a different system for my desktop. A contractor came in and installed some SUN... (0 Replies)
Discussion started by: bitlord
0 Replies

4. Red Hat

SSH keys are not working

Hi, I've generated and posted pub. keys in the source system and the target. However, it is still prompting me for the password. Steps that I have taken. 1. Generated ssh keys : ssh-keygen. It created two files. 1. .ssh/id_rsa 2. .ssh/ 2.... (10 Replies)
Discussion started by: Afi_Linux
10 Replies

5. Shell Programming and Scripting

What are public keys in ssh and how do we create the public keys??

Hi All, I am having knowledge on some basics of ssh and wanted to know what are the public keys and how can we create and implement it in connecting server. Please provide the information for the above, it would be helpful for me. Thanks, Ravindra (1 Reply)
Discussion started by: ravi3cha
1 Replies

6. Shell Programming and Scripting

Sharing SSH Keys

I have 2 systems A and B I need to do a passwd less authentication inorder to send a file from system B to system A automatically(using sftp) for this i did the following I generated ssh-keygen -t dsa on system B, copied this key( into the authorized_keys file on system A... (1 Reply)
Discussion started by: ramky79
1 Replies

7. UNIX for Dummies Questions & Answers

ssh keys monitoring

Hi, I have ssh keys (id_rsa and However, every once in a while, someone deletes these keys. here's what i want to do : 1. on my server, it will ssh user@password into the target machine(where ssh keys are located). 2. check the date/filesize of id_rsa, 3.... (0 Replies)
Discussion started by: tungaw2004
0 Replies

8. UNIX for Dummies Questions & Answers

SSH keys

Hi everyone, i wanted to generate ssh keys so that i can include the public key in the remote sever, so that for subsequent logins, i can do away with the keying in of the password. I consulted the man ssh-keygen man pages. "..Normally each user wishing to use SSH with RSA or DSA... (1 Reply)
Discussion started by: new2ss
1 Replies

9. UNIX for Advanced & Expert Users

SSH Keys Help

Hello, I'm wondering if anyone has a step-by-step instruction set for setting up ssh keys? I've gone through many of the manuals online (most seem to be from the same source) and it's a little bit unclear when the documentation is talking about the server versus the client machine. I'm missing... (1 Reply)
Discussion started by: sysera
1 Replies

Featured Tech Videos