aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Bilyk <jbilyk@gmail.com>2011-07-31 17:34:38 -0400
committerJeff Bilyk <jbilyk@gmail.com>2011-07-31 17:34:38 -0400
commit43e5c986658efd3e12e1fe8febb12bae04b3b5fa (patch)
tree118f272e298231ead2bd3c9f8b9d9a5a0f09e851
parent69f1406837746d28913937eb353867ac49131ee6 (diff)
downloadalpine-conf-43e5c986658efd3e12e1fe8febb12bae04b3b5fa.tar.bz2
alpine-conf-43e5c986658efd3e12e1fe8febb12bae04b3b5fa.tar.xz
setup-sshd: add dropbear support
-rw-r--r--setup-alpine.in8
-rwxr-xr-xsetup-sshd.in40
2 files changed, 18 insertions, 30 deletions
diff --git a/setup-alpine.in b/setup-alpine.in
index 8fa5921..075ca07 100644
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -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
diff --git a/setup-sshd.in b/setup-sshd.in
index 4de32ac..d7f3986 100755
--- a/setup-sshd.in
+++ b/setup-sshd.in
@@ -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