I have 2 ubuntu 14.04 servers in vm in my machine.I logged in the 2 servers as the user chandhu, then by using sudo -i , I changed as root. I have one file in the user chandhu.I wanna to move that from one server to another by using rsync. While I am entering the following command:
rsync -avh /home/chandhu/me.txt root@192.168.151.123:/home/chandhu/
there showing the error. But while I enter the command as this:
rsync -avh /home/chandhu/me.txt chandhu@192.168.151.123:/home/chandhu/
the things are going smoothly. then what was the reason for that error?
Error message is given below
rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.0]
Best Answer
If not already done, you have to ensure that root loging via SSH on 192.168.151.123 is permitted. Root login is denied by default. Secondly, you have to set a root password, which is also not set by default.
Permit root login:
Restart ssh service:
Set root password: