Hetzner Cloud Server erstellen
Hetzner Cloud Console öffnen und neuen Server hinzufügen
- Name
- [NAME]-server
- Standort
- nur Europa
- egal ob Nürnberg / Falkenstein / Helsinki
- Image
- Debian
- aktuellste Version (aktuell 12)
- Typ
- Shared für variable Lasten
- Dedicated für konstante Lasten
- IP
- v4 + v6
- SSH-Keys
- persönlichen Public Key hinzufügen
- Key benennen
nachname@[NAME]
- Firewall auswählen: [NAME]-firewall
- Cloud config
#cloud-configusers:- name: aleksandar.damjanovicgroups: users, adminsudo: ALL=(ALL) NOPASSWD:ALLshell: /bin/bashssh_authorized_keys:- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ+cYe1dd69gJWu2aQrF4tL+XKEVK7pCnl8jQMUVt/JTpackages:- fail2ban- ufw- ncdu- bpytop- vim- git- haveged- unzip- dos2unixpackage_update: truepackage_upgrade: trueruncmd:- printf "[sshd]\nenabled = true\nbanaction = iptables-multiport" > /etc/fail2ban/jail.local- systemctl enable fail2ban- ufw allow OpenSSH- ufw enable- sed -i -e '/^\(#\|\)PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)KbdInteractiveAuthentication/s/^.*$/KbdInteractiveAuthentication no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)ChallengeResponseAuthentication/s/^.*$/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)MaxAuthTries/s/^.*$/MaxAuthTries 2/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)AllowTcpForwarding/s/^.*$/AllowTcpForwarding no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)X11Forwarding/s/^.*$/X11Forwarding no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)AllowAgentForwarding/s/^.*$/AllowAgentForwarding no/' /etc/ssh/sshd_config- sed -i -e '/^\(#\|\)AuthorizedKeysFile/s/^.*$/AuthorizedKeysFile .ssh\/authorized_keys/' /etc/ssh/sshd_config- sed -i '$a AllowUsers aleksandar.damjanovic' /etc/ssh/sshd_config- reboot
- Server erstellen (kostenpflichtig erstellen)
- Server wird nun im Hintergrund erstellt, das kann einen Moment dauern
- Root Passwort zurücksetzen
- Root Passwort über die Server-Einstellungen zurücksetzen (Rescue -> Root-Passwort)
- Root Passwort im Passwordmanager speichern unter
Baunach [NAME] - Root