Upgrade the system packages.
1
| sudo apt update && sudo apt dist-upgrade
|
Clean up the container (optional)
1
| sudo apt clean && sudo apt autoremove
|
Add a new user.
1
| adduser {your username}
|
Change to /etc/ssh directory.
Clear out the host keys (make sur eyou stay logged in).
Make the machine ID unique. First check that it exists (it will show up as a string of characters).
Clear it out.
1
| sudo truncate -s 0 /etc/machine-id
|
Shut down the container.
In Proxmox, right click on container and convert container to a template.
Start it up and use the console to login and run the following command.
1
| sudo dpkg-reconfigure openssh-server
|
Then, in a terminal, try to ssh into the container.
1
| ssh {your_username}@{your_ip}
|
You can get the IP of your container from the console in Proxmox by running: