Hetzner Cloud-Init Pro
Cloud-Init Konfigurationen für Hetzner Cloud Server erstellen.
Config Generator
Cloud-Init YAML in Sekunden
user-data
#cloud-config
timezone: Europe/Berlin
users:
- name: admin
groups: users, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
packages:
- htop
package_update: true
power_state:
mode: reboot
message: Rebooting after cloud-init completes
condition: True
runcmd:
- "cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak"
- "sed -i -e '/^#\\?Port/s/^.*$/Port 22/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?PasswordAuthentication/s/^.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?AllowTcpForwarding/s/^.*$/AllowTcpForwarding yes/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?MaxAuthTries/s/^.*$/MaxAuthTries 5/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?PubkeyAuthentication/s/^.*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?AuthorizedKeysFile/s/^.*$/AuthorizedKeysFile .ssh/authorized_keys/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?UsePAM/s/^.*$/UsePAM yes/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?X11Forwarding/s/^.*$/X11Forwarding no/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?PrintMotd/s/^.*$/PrintMotd no/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?AcceptEnv/s/^.*$/AcceptEnv LANG LC_*/' /etc/ssh/sshd_config"
- "sed -i -e '/^#\\?Subsystem/s/^.*$/Subsystem sftp /usr/lib/openssh/sftp-server/' /etc/ssh/sshd_config"
- "echo 'AllowUsers admin root' >> /etc/ssh/sshd_config"
- "systemctl restart sshd"
Unterstütze dieses Tool
Noch keinen Hetzner Account? Registriere dich über diesen Link und starte mit einem der besten Cloud-Anbieter. Zu Hetzner Cloud
Valid