Skip to content

Instantly share code, notes, and snippets.

@OffS3c
Created March 23, 2021 13:23
Show Gist options
  • Save OffS3c/894f9241182441846554af824f88d593 to your computer and use it in GitHub Desktop.
Save OffS3c/894f9241182441846554af824f88d593 to your computer and use it in GitHub Desktop.
install-dedicated.sh
#!/bin/bash
apt update
apt install sudo curl wget openssh-server openssh-client -y
echo "\nPermitRootLogin yes\n" >> /etc/ssh/sshd_config
mkdir -p /root/.ssh
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKzHjLj3ITbxxeO3Boyf+3UPeymzzWOLBbmO01IHUcuI jk.offs3c@gmail.com\n" >> /root/.ssh/authorized_keys
chown -R root:root /root/.ssh
chmod 644 /root/.ssh/authorized_keys
systemctl enable ssh
systemctl restart ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment