Created
April 30, 2025 10:46
-
-
Save musichen/4be5847df8e297bdec6468d2bf0a738e to your computer and use it in GitHub Desktop.
wbx-cloud-init.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cloud-config | |
| # Updated configuration for Ubuntu 24.04 | |
| users: | |
| - name: wbx | |
| ssh_authorized_keys: | |
| - "ssh-ed25577 <SSHKEYHASH_HERE> wbx@wbx" | |
| sudo: ALL=(ALL:ALL) ALL | |
| groups: sudo | |
| shell: /bin/bash | |
| chpasswd: | |
| expire: true | |
| users: | |
| - name: wbx | |
| password: changeme | |
| type: text | |
| ssh_pwauth: false | |
| write_files: | |
| - path: /etc/needrestart/conf.d/99disable-prompt.conf | |
| content: | | |
| $nrconf{kernelhints} = -1; | |
| package_update: true | |
| package_upgrade: true | |
| package_reboot_if_required: true | |
| runcmd: | |
| # Configure SSH securely | |
| - sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config | |
| - echo "PermitRootLogin prohibit-password" >> /etc/ssh/sshd_config | |
| - sed -i '/PubkeyAuthentication/d' /etc/ssh/sshd_config | |
| - echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config | |
| - sed -i '/PasswordAuthentication/d' /etc/ssh/sshd_config | |
| - echo "PasswordAuthentication no" >> /etc/ssh/sshd_config | |
| - systemctl restart ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment