LXC Template from Backup issues

apmuthu

Renowned Member
Feb 26, 2009
871
11
83
Chennai - India & Singapore
github.com
A Debian 10 (Buster) Template was used to create a container and updated and then backed up and renamed as a later version template using the second method as described therein at:
https://febryandana.xyz/posts/proxmox-create-lxc-instance-and-template/

If a new container is created with the updated template using static ip, all works fine is the following are done on startup (/etc/hosts does not have a domain but search is the domain):
Bash:
ssh-keygen -q -t rsa -b 4096 -f ~/.ssh/id_rsa -P "" <<<y >/dev/null 2>&1
# If not done and needed:
# sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
service ssh restart
If DHCP is used in creating the new container, the SSH will not work correctly as the /etc/hosts will have a local IP like 127.0.1.2 and the /etc/resolv.conf will have both domain and search as localdomain.
 
Last edited: