From 2f446dc749d549204240d842a3d45b773b819eb4 Mon Sep 17 00:00:00 2001 From: jgrogan Date: Mon, 26 Aug 2024 15:56:25 +0100 Subject: [PATCH] Add hosting fixes --- doc/hosting_notes.md | 0 infra/scripts/setup_machine.sh | 17 ++++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 doc/hosting_notes.md diff --git a/doc/hosting_notes.md b/doc/hosting_notes.md new file mode 100644 index 0000000..e69de29 diff --git a/infra/scripts/setup_machine.sh b/infra/scripts/setup_machine.sh index 0278354..a853419 100644 --- a/infra/scripts/setup_machine.sh +++ b/infra/scripts/setup_machine.sh @@ -1,9 +1,5 @@ export MY_USER="my_user" -# Create non-root user -adduser $MY_USER -usermod -aG sudo $MY_USER - # Set up firewall ufw allow OpenSSH ufw enable @@ -14,10 +10,17 @@ ufw enable # PasswordAuthentication no # ChallengeResponseAuthentication no # UsePAM no -# sudo systemctl restart ssh + +# Create non-root user +adduser $MY_USER +usermod -aG sudo $MY_USER # Enable ssh login -rsync --archive --chown=$MY_USER:$MY_USER ~/.ssh /home/$MY_USER +rsync --archive --chown=$MY_USER:$MY_USER ~/.ssh /home/$MY_USER/.ssh # Fail2ban for SSH -apt install fail2ban \ No newline at end of file +apt install fail2ban + +# Restart ssh +sudo systemctl restart ssh +