- Create Proxmox Container based on Ubuntu with SSH Key, not a password
- No IPv4, SLAAC for IPv6
- Modify container via host shell to add tun device, this will get copied when cloning
/etc/pve/lxc/$ID.conf
lxc.cgroup2.devices.allow: c 10:200 rwm lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
- Start Container
- In Proxmox host shell run
lxc-info -n $ID
to get IPv6 Address to ssh - Commands to run in the bootstrap container template during first creation
apt update apt upgrade apt install python3-launchpadlib ssh-import-id adduser --disabled-password --comment "" rbelgrave echo 'rbelgrave ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/rbelgrave sudo -u rbelgrave ssh-import-id-lp rmb1993 apt install curl net-tools curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/$(lsb_release -cs).noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/$(lsb_release -cs).tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list apt update apt install tailscale
- Remove root authorized ssh key
: > /root/.ssh/authorized_keys
- TODO: figure out how to regenerate ssh host keys
- Shutdown Container in Proxmox UI
- Convert to Template
Last active
October 19, 2024 17:30
-
-
Save rmb938/47de40fefe71024ccc30c6029574aed8 to your computer and use it in GitHub Desktop.
Bootstrap Proxmox Container Template Commands
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turned into https://github.com/rmb938/ansible_proxmox_container_template_bootstrap