I have one server with webmin/Virtualmin installed. I use it as a backup server. I backup over ssh from another webmin/virtualmin server. I use keypair for authentication and password is disabled.
I can connect between the servers using SSH but when I try to run a backup I get
Permission denied (publickey). lost connection
Where does it go wrong?
I have a third server without CP that I also back up using rsync over ssh and that work flawless
You authenticate IN with one set of keys but you probably need another key pair to initiate the outbound connection?
I log into the server on a different, privileged account. The backup account on the remote machine (one the server is saving the files to) is pretty restricted. Enough to login and save files. The backup doesn’t need, and probably shouldn’t have, an account with escalation privileges. It just stores files.
The strange thing is that it works flawless from the email server that has no CP, I just run an rsync script via cron.
So I really dont understand what is happening. And it has worked before, then I reinstalled the backup server and it stopped working from the webserver. I will test with same cronscript I use for the other server.
I just found out that if I use ssh system@1.2.3.4 it fail with Permission denied (publickey). lost connection
But if I use ssh -i /system/.ssh/id_ed25519_new system@1.2.3.4 it works
You’ll need to use an ssh configuration file for that user to use that key for that destination host. Or delete old keys, such that you don’t get too many failures by the time it tries the “new” one.
Hi Joe! I dont know what went wrong but I created a new user and a new keypair and now it works. As you suggested I have also cleaned out some old keys so each user only have one keypair in the ssh folder