Lost SSH keys for logging into your server

I recently lost my SSH key for login into my server. Not going to delve into details about how the hell I manged this, but let's just say it involved me getting too excited about an SSD...

So anyway, luckily, I have Webmin installed on my server, so I am able to access a very basic form of terminal. So if you have ever lost your SSH keys by accident, don't despair (unless you have not got Webmin installed, then yes, panic and hope your VPS provider has a working terminal you can use...)

So to generate new keys for you to use:

ssh-keygen -q -t rsa -f /home/james/.ssh/id_rsa -N ""

Then add the /home/james/.ssh/id_rsa to your authorized_keys file and done. You have new SSH keys you can use. Just make sure to back it up this time before you lose it...