I'm attempting to use rsync on a new RHEL server to copy files/directory from a remote Ubuntu server. I used rsync -avx remote@host.com:/var/www/ /var/www/html
I'm then prompted for the password for remote@host.com and provide it. Unfortunately, I receive permission denied (publickey,password). Note that the username I'm using on the RHEL server is different from the username on the Ubuntu server.
How do I rectify this issue?
Thanks!!
Best Answer
You are having a problem with ssh, not with rsync that is trying to use ssh as a transport. First get to the point where just
ssh remote@host.com
works, and work from there. If you are being prompted for a password but you still cannot login, then either you have the wrong password (most likely), or there is some other problem. If you are certain you have the correct password, then the best way to debug this is from the server side. First check the server logs (/var/log/secure on RH). If there is nothing useful there, my recommendation to debugging this beyond the password would be to run/usr/sbin/sshd -d -p 2222
on the server to start a sshd in debug mode, then tryssh -p 2222 remote@host.com
from the client side. Then see what messages come out from the server when authentication fails.