I screwed up and accidentally deleted some files on my Proxmox server

Oct 3, 2022
2
0
6
I was following Learn Linux TV video tutorial to create a VM template. I mistakenly ran the following commands on the Proxmox server and not the VM:
sudo rm /etc/ssh/ssh_host_*
sudo truncate -s 0 /etc/machine-id
sudo ln -s /etc/machine-id /var/lib/dbus/machine-id

I still have console access but no ssh capability. How do I fix SSH access and anything else I may have screwed up? This Proxmox server is part of my homelab but has about a dozen VMs currently on it. So I would like to avoid a fresh install. Hopefully its a simple fix.

Note: I'm a network guy trying to learn some sysadmin skills. I know enough about Linux to be dangerous.
 
I don't think you can recreate the SSH host keys or machine-id from thin air. Did you backup the /etc directory on the Proxmox host (at any point in time, since those files don't change much)?
There is probably a Linux guide on the internet about creating new SSH host keys. I have no idea how that would affect Proxmox software but maybe it's alright for a stand-alone host.
 
  • Like
Reactions: Kingneutron