Linux – rsync + Permission denied

linux

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)

Best Answer

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.