Did anyone managed to make an automatic ssh login to the server?
I want to back-up my images using rsync. I have tried to put the public keys made on the computer in the authorized_keys but when I ssh the server it promts me the password.
Did anyone managed to make an automatic ssh login to the server?
I want to back-up my images using rsync. I have tried to put the public keys made on the computer in the authorized_keys but when I ssh the server it promts me the password.
Hi,
it’s most probably a permission problem with the authorized_keys file and the .ssh folder.
Hint: I ran into an issue where I couldn’t login to the Web UI after setting the SSH keys (I had no password set for the WebUI user) the automatic SSH login worked though. So I removed the .ssh folders, set a password for the WebUI user, then set the keys again, logged into the WebUI and disabled the password for the WebUI user again and now everything works fine - I even rebooted the device to make sure.
Be really careful, this could brick your MyCloud!
Here’s how I did it:
The commands need to be executed on your computer and NOT on the MyCloud (but I think I don’t have to mention that).
Creates the folder /root/.ssh on your MyCloud and sets chmod to 700 :
ssh root@<YOUR MY CLOUD IP> 'mkdir -m 700 -p ~/.ssh'
Appends your public key to the authorized_keys file and sets chmod to 640 :
cat ~/.ssh/id_rsa.pub | ssh root@<YOUR MY CLOUD IP> 'cat >> ~/.ssh/authorized_keys && chmod 640 ~/.ssh/authorized_keys'
You should be able to run this on the computer and password less login should work:
i.e if you dont have anything else in the authorized keys on the wd cloud drive.
ssh-keygen -t rsa -b 1024
scp /root/.ssh/id_rsa.pub root@my_cloud_ip:/root/.ssh/authorized_keys
On another note rsync using rsync daemon might be faster than over ssh.
Why do you need to do your own rsync? The built in SAFEPOINT utility runs rsync for you
Startup a SAFEPOINT backup and run top, you will see it is using rsync to copy to the USB attached drive.