From 64ef1b3830cd37caf726470f0ff12264252e956e Mon Sep 17 00:00:00 2001 From: velvettear Date: Wed, 14 Apr 2021 10:20:13 +0200 Subject: [PATCH] fixed dropbear setup --- debian_install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian_install.sh b/debian_install.sh index 08d3af6..a812c85 100755 --- a/debian_install.sh +++ b/debian_install.sh @@ -87,8 +87,8 @@ printf "|> adding user '$user' to group 'sudo'...\n" && addgroup "$user" sudo > printf "|> modifying sudoers...\n" sed -i "s/# %sudo ALL=(ALL) ALL/%sudo ALL=(ALL) ALL/" "/etc/sudoers" -#printf "|> disabling root login via ssh...\n" -#sed -i "s/DROPBEAR_OPTS.*/DROPBEAR_OPTS=\"-w\"/" "/etc/conf.d/dropbear" +printf "|> disabling root login via ssh...\n" +sed -i "s/DROPBEAR_EXTRA_ARGS.*/DROPBEAR_EXTRA_ARGS=\"-w\"/" "/etc/default/dropbear" [[ -r "$HOME/.ssh/authorized_keys" ]] && printf "|> moving authorized ssh keys from '$USER' to '$user'...\n" && mkdir -p "/home/$user/.ssh" &> /dev/null && mv "$HOME/.ssh/authorized_keys" "/home/$user/.ssh/authorized_keys" && chown -R "$user":users "/home/$user/.ssh" @@ -102,6 +102,7 @@ printf "|> disabling sshd...\n" systemctl disable sshd printf "|> enabling and starting dropbear...\n" +sed -i "s/NO_START.*/NO_START=\"0\"/" "/etc/default/dropbear" systemctl enable dropbear --now [[ "$swappiness" ]] && printf "|> tuning swappiness...\n" && printf "vm.swappiness="$swappiness"" > "/etc/sysctl.d/99-swappiness.conf"