From aed5b8da81e1178246621e6b58019b7d666ccb6f Mon Sep 17 00:00:00 2001 From: Alexandre CATTEAU Date: Wed, 27 Apr 2022 16:55:15 +0200 Subject: [PATCH] Few fixes --- setup.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 2bfcd5c..8836c54 100644 --- a/setup.sh +++ b/setup.sh @@ -36,12 +36,12 @@ get_sync() { echo "Getting and deploying sync configuration" sudo -H -u $user mkdir $sync_directory_path sudo -H -u $user git clone https://gitea.kto.black/adminconf/rcs-general.git $sync_directory_path/rcs-general - sudo -H -u $user $sync_directoyy_path/rcs-general/install.sh + sudo -H -u $user $sync_directory_path/rcs-general/install.sh sudo -H -u $user git clone https://gitea.kto.black/adminconf/conf-sync.git $sync_directory_path/conf-sync sudo -H -u $user cp $sync_directory_path/conf-sync/variables.conf.template \ $sync_directory_path/conf-sync/variables.conf sudo -H -u $user sed -i -e "s/\"desktop\"/\"server\"/g" $sync_directory_path/conf-sync/variables.conf - sudo -H -u $user $sync_directoyy_path/conf-sync/install.sh + sudo -H -u $user $sync_directory_path/conf-sync/install.sh } ssh_pubkey() { @@ -51,6 +51,12 @@ ssh_pubkey() { sudo -H -u $user mv /home/$user/.ssh/$remote_pubkey /home/$user/.ssh/authorized_keys } +set_sshd_conf() { + echo "Editing OpenSSH daemon config..." + sed -i -e "s/#PasswordAuthentication yes/PasswordAuthentication no/g" /etc/ssh/sshd_config + sed -i -e "s/PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config +} + set_cpufreq() { if [ $default_hostname = 'orangepizero' ]; then echo "Setting CPU frequency to performance" @@ -85,14 +91,17 @@ remote_pubkey='home.pub' init install_packages add_users -get_conf +get_sync ssh_pubkey +set_sshd_conf +set_cpufreq echo "" echo "We're all good here!" echo "You should now:" echo "* set $user's password" echo "* lock root account" +echo "* copy your SSH config file" echo "* reboot the SBC" echo "And perhaps:" echo "* set htop at your convenience"