diff --git a/scripts/start.sh b/scripts/start.sh index 800e26c2..091a4ed0 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,3 +1,16 @@ +# Check system setup. +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. if [ -z "$PUBLIC_HOSTNAME" ]; then echo echo "Enter the hostname you want to assign to this machine." @@ -18,6 +31,7 @@ fi if [ -z "$STORAGE_ROOT" ]; then if [ ! -d /home/user-data ]; then useradd -m user-data; fi STORAGE_ROOT=/home/user-data + mkdir -p $STORAGE_ROOT fi . scripts/system.sh diff --git a/scripts/system.sh b/scripts/system.sh index efd2be8d..18ae4a80 100755 --- a/scripts/system.sh +++ b/scripts/system.sh @@ -20,8 +20,5 @@ if [ -z "$DISABLE_FIREWALL" ]; then ufw --force enable; fi -# Mount the storage volume. -export STORAGE_ROOT=/home/ubuntu/storage -mkdir -p storage