ssh key changed after reboot

1 post / 0 new
#1 Sun, 01/13/2019 - 03:55
su1

ssh key changed after reboot

Hi,

I'm a new virtualmin user, coming from cPanel.

I've bought a VPS server (ubuntu 16.04) and set a public ssh key at this moment (my hosting company allows me to do so before payment). I was able to access my server using this key, installed virtualmin no problem, created a non-root user, used this user to log in to virtualmin dashboard and make a few security changes (disable root login, disable password login, disable ftp...). So far so good.

Then I rebooted the server and I'm now unable to login with my ssh key. I always get a permission denied message. I went to SSH servers > Host SSH keys and noticed the key is not mine (it ends with root@server1). I'm also unable to change this file, I can edit it but there is no button to validate.

So is this normal behavior to change the existing ssh public key after reboot? And how do I add back my old public ssh key? Do I have to re-enable root password logins, make the changes with the command line, and re-disable root password login after that? [Edit: I've done that, but I'd like to know if this public key will be erased again at the next reboot]

I may be missing something simple here as I'm a total newbie.