Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 machine is:

login=root password=moon

 rsync -WavH  --progress .

 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
I'm really hoping that you didn't just post the root password for your server. – kce Nov 13 '11 at 9:53

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@ .

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@ .

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@ .

share|improve this answer
I get the same error – Diana Nov 13 '11 at 8:55
try to run: "ssh root@ 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
@Diana of course you need the password. You are trying to access a file on 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


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.