From 6e8f8e830ee413840a42b92cd5e09e5de48cb5df Mon Sep 17 00:00:00 2001 From: jakubknczny Date: Wed, 24 Nov 2021 16:46:08 +0100 Subject: [PATCH] fix path --- cloud-init | 5 +++-- setup.sh | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cloud-init b/cloud-init index 0d3c963..a44f539 100644 --- a/cloud-init +++ b/cloud-init @@ -12,6 +12,7 @@ packages: package_update: true package_upgrade: true runcmd: - - "wget https://git.wmi.amu.edu.pl/s470607/code-server-test/src/branch/master/setup.sh" + - "wget https://git.wmi.amu.edu.pl/s470607/code-server-test/raw/branch/master/setup.sh" - "chmod +x setup.sh" - - "sh setup.sh" + - "bash setup.sh" + - "reboot" diff --git a/setup.sh b/setup.sh index cab73f8..f24d4c9 100644 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,10 @@ #!/bin/bash + +curl -fOL https://github.com/cdr/code-server/releases/download/v3.12.0/code-server_3.12.0_amd64.deb +dpkg -i code-server_3.12.0_amd64.deb +systemctl enable --now code-server@kk + + printf "[sshd]\nenabled = true\nbanaction = iptables-multiport" > /etc/fail2ban/jail.local systemctl enable fail2ban ufw allow OpenSSH @@ -10,6 +16,5 @@ 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 '/^#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 holu' /etc/ssh/sshd_config -reboot +sed -i '$a AllowUsers kk' /etc/ssh/sshd_config