Commit 43e5c986 authored by Jeff Bilyk's avatar Jeff Bilyk

setup-sshd: add dropbear support

parent 69f14068
......@@ -73,11 +73,11 @@ sed -i -e "s/^127\.0\.0\.1.*/127.0.0.1\t${_hn}.${_dn:-$(get_fqdn)} ${_hn} localh
$PREFIX/sbin/setup-apkrepos
$PREFIX/sbin/setup-sshd
$PREFIX/sbin/setup-ntp
DEFAULT_DISK=none \
$PREFIX/sbin/setup-disk -q
$PREFIX/sbin/setup-apklbu -i
$PREFIX/sbin/setup-ntp
$PREFIX/sbin/setup-sshd
......@@ -8,48 +8,36 @@ usage() {
cat <<__EOF__
usage: setup-sshd [-hnp]
Setup sshd, turning off server side DNS lookups and password authentication by default
Setup sshd
options:
-h Show this help
-n Don't prompt, just use defaults
-p Leave password authentication enabled
__EOF__
exit 1
}
PASSWORDAUTH="N"
while getopts "hnp" opt; do
while getopts "hn" opt; do
case $opt in
n) PROMPT="0";;
h) usage;;
p) PASSWORDAUTH="Y";;
esac
done
if [ "$PROMPT" != "0" ]; then
echo "Setup sshd? (y/N)"
default_read setupsshd "N"
if [ "$setupsshd" = "N" ] || [ "$setupsshd" = "n" ]; then
exit 0
fi
echo "Sshd to setup? (openssh, dropbear, none) [openssh]"
default_read setupsshd "openssh"
if [ "$setupsshd" = "none" ]; then
exit 0
fi
exit 1
acfinstalled="`apk version acf-core -q | awk '{print $1}'`"
if [ "$acfinstalled" != "ERROR:" ]; then
apk add acf-openssh -q
else
apk add openssh -q
fi
if [ "$PASSWORDAUTH" = "N"]; then
printf "PasswordAuthentication no\nUseDNS no\n" >> /etc/ssh/sshd_config
else
printf "UseDNS no\n" >> /etc/ssh/sshd_config
if [ "setupsshd" = "openssh"]; then
if [ "$acfinstalled" != "ERROR:" ]; then
apk add acf-openssh -q
else
apk add openssh -q
fi
elif [ "setupsshd" = "dropbear"]; then
apk add dropbear
fi
/etc/init.d/sshd start
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment