I have a Digital Ocean droplet (SERVER A) that uses an SSH key and password for my root account. I created an additional user and added it to a new SFTPUsers group by following this guide:
https://www.digitalocean.com/community/questions/how-do-i-restrict-a-user-to-a-specific-directory
I also have another server on a shared host (not on Digital Ocean) that has nightly backup files. (SERVER B)
I would like to securely copy these nightly backups each night from SERVER B to a directory on my DO server (SERVER A) that my backup user has access to, and would like to do it with a script so that it doesn't ask for a password so it can just run. I'm really confused about where to go from here. I find the more I research, the more confused I get. I generate a public/private key on SERVER B and then copy the public key to server A? Then what happens?
Where do I go from here as far as being able to SCP a file from my one server to the digital ocean server? I'd like to do this using my new user I created. Would really welcome any help / pointers in the right direction. I tried doing reading on SSH / public/private keys but still don't feel like I'm making progress :(
Thanks!