Commit 7c5c9774 authored by Joshua Tauberer's avatar Joshua Tauberer

Merge pull request #34 from daniellawrence/handle_no_sshd

move the ssh PasswordAuthentication check to after installing ssh
parents 58881f72 63223f6b
...@@ -13,17 +13,6 @@ if [ "`lsb_release -d | sed 's/.*:\s*//'`" != "Ubuntu 14.04 LTS" ]; then ...@@ -13,17 +13,6 @@ if [ "`lsb_release -d | sed 's/.*:\s*//'`" != "Ubuntu 14.04 LTS" ]; then
exit exit
fi fi
# Check that SSH login with password is disabled. Stop if it's enabled.
if grep -q "^PasswordAuthentication yes" /etc/ssh/sshd_config \
|| ! grep -q "^PasswordAuthentication no" /etc/ssh/sshd_config ; then
echo
echo "The SSH server on this machine permits password-based login."
echo "Add your SSH public key to $HOME/.ssh/authorized_keys, check"
echo "check that you can log in without a password, set the option"
echo "'PasswordAuthentication no' in /etc/ssh/sshd_config, and then"
echo "restart the machine."
exit
fi
# Gather information from the user about the hostname and public IP # Gather information from the user about the hostname and public IP
# address of this host. # address of this host.
......
...@@ -3,6 +3,21 @@ ...@@ -3,6 +3,21 @@
apt-get -q -q update apt-get -q -q update
apt-get -q -y upgrade apt-get -q -y upgrade
# Install openssh-server to ensure that the end result is consistent across all Mail-in-a-Boxes.
apt-get -q -y install openssh-server
# Check that SSH login with password is disabled. Stop if it's enabled.
if grep -q "^PasswordAuthentication yes" /etc/ssh/sshd_config \
|| ! grep -q "^PasswordAuthentication no" /etc/ssh/sshd_config ; then
echo
echo "The SSH server on this machine permits password-based login."
echo "Add your SSH public key to $HOME/.ssh/authorized_keys, check"
echo "check that you can log in without a password, set the option"
echo "'PasswordAuthentication no' in /etc/ssh/sshd_config, and then"
echo "restart the openssh via 'sudo service ssh restart'"
exit
fi
apt-get -q -y install python3 apt-get -q -y install python3
# Turn on basic services: # Turn on basic services:
......
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