Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to copy the some_file using rsync to my machine (red hat 5.3) from other linux server also (red hat 5.3)

Is it possible to copy the file without to get "Permission denied." ?

Remark - the login and password on 130.146.120.11 machine is:

login=root password=moon

 rsync -WavH  --progress 130.146.120.11:/tmp/some_file .

 Permission denied.
 rsync: connection unexpectedly closed (0 bytes read so far)
 rsync error: error in rsync protocol data stream (code 12) at io.c(165)
share|improve this question
6  
I'm really hoping that you didn't just post the root password for your server. –  kce Nov 13 '11 at 9:53

4 Answers 4

It looks like you need to supply a password to access your remote system. You can do this by using the --password-file=/path/to/file/containing/password.

rsync -WavH --password-file=/$HOME/passfile --progress root@130.146.120.11:/tmp/some_file .

Make sure that the permissions on /$HOME/passfile are 600 (chmod 600 /$HOME/passfile) otherwise you may leave ypur root password on view.

share|improve this answer
    
so if the password is moon the I can only to write moon in passfile? for example echo "moon" > /$HOME/passfile –  Diana Nov 13 '11 at 10:24
    
please advice how to edit the /$HOME/passfile file ? –  Diana Nov 13 '11 at 10:53
    
In whatever manner you usually edit a text file, personally I'd do it with vi. –  Iain Nov 13 '11 at 12:25
    
I edit the file with moon password , but it give me Permission denied -:( –  Diana Nov 13 '11 at 13:02

rsync can connect either to a remote shell (default) or a rsync daemon listening on TCP port 873. Since you did not state that you are running a rsync daemon and since you are not using double colons :: in your host string I'm assuming that you are connecting with a remote shell. It's quite possible that your rsync binaries are trying to use rlogin which is an extremely old and insecure protocol and is usually disabled on most newer distros. The more preferred option whilst using a remote shell is to use SSH via shared key authentication and then add the -e ssh or --rsh=ssh argument in your rsync command.

rsync -WavH --progress -e ssh root@130.146.120.11:/tmp/some_file .

I would also recommend highly that you do not use the root user if at all possible to do this sort of operation. If root is absolutely necessary I would even highlier (is that a word) recommend that you use shared keys instead of password authentication.

Hope this helps.

share|improve this answer

Try using:

rsync -WavH --progress root@130.146.120.11:/tmp/some_file .

share|improve this answer
    
I get the same error –  Diana Nov 13 '11 at 8:55
    
try to run: "ssh root@130.146.120.11 ls -l /tmp/some_file" and share the output –  Farhan Nov 13 '11 at 8:58
    
needs password: for this –  Diana Nov 13 '11 at 9:30
1  
@Diana of course you need the password. You are trying to access a file on 130.146.12.11 as root. Either you supply the root password or you set up access via private/public key. –  Matteo Nov 13 '11 at 10:01

I cannot see why you don't simply use SSH key authentication. It would be the most simple...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.