Skip to content

Instantly share code, notes, and snippets.

@uzulla
Created March 28, 2025 10:42
Show Gist options
  • Save uzulla/5fdd337e411483c3c80519ee758ed6cb to your computer and use it in GitHub Desktop.
Save uzulla/5fdd337e411483c3c80519ee758ed6cb to your computer and use it in GitHub Desktop.
#cloud-config for xubuntu 24.04
autoinstall:
version: 1
identity:
hostname: plain-xubuntu
username: doe
password: "$6$aW3pQdLQ05RQoG0M$sTFlndcayhG3rlB0j.kTOh0499JmqzcoQI.uGaz0xjJ/0ifSpU59.gqf4NcnXGV4e4kLA5IybQ70S2d1P301d1"
ssh:
install-server: true
allow-pw: false
packages:
- ubuntu-desktop-minimal
late-commands:
- curtin in-target -- apt-get update
- curtin in-target -- apt-get install -y openssh-server wget
- curtin in-target -- mkdir -p /home/doe/.ssh
- curtin in-target -- wget -O /home/doe/.ssh/authorized_keys https://github.com/uzulla.keys
- curtin in-target -- chown -R doe:doe /home/doe/.ssh
- curtin in-target -- chmod 700 /home/doe/.ssh
- curtin in-target -- chmod 600 /home/doe/.ssh/authorized_keys
- curtin in-target -- sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
- curtin in-target -- systemctl restart sshd
- curtin in-target -- usermod -aG sudo doe
- echo 'doe ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/90-doe
@uzulla
Copy link
Author

uzulla commented Mar 28, 2025

mkpasswd -m sha-512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment