fixed dropbear setup
This commit is contained in:
parent
e8c0449b3f
commit
64ef1b3830
1 changed files with 3 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue