Set new password definition at setup

This commit is contained in:
Alexandre CATTEAU 2022-04-27 20:46:08 +02:00
parent aed5b8da81
commit cdd9be6aae

View File

@ -30,6 +30,8 @@ add_users() {
echo "Adding users" echo "Adding users"
useradd -U -G sudo -m -s /bin/bash $user useradd -U -G sudo -m -s /bin/bash $user
chmod 700 /home/$user chmod 700 /home/$user
echo "Let's define a password for $user as we are about to run sudo with it. It can of course be changed after setup."
passwd $user
} }
get_sync() { get_sync() {
@ -99,14 +101,11 @@ set_cpufreq
echo "" echo ""
echo "We're all good here!" echo "We're all good here!"
echo "You should now:" echo "You should now:"
echo "* set $user's password"
echo "* lock root account" echo "* lock root account"
echo "* copy your SSH config file" echo "* copy your SSH config file"
echo "* reboot the SBC" echo "* reboot the SBC"
echo "And perhaps:" echo "And perhaps:"
echo "* set a new password for $user"
echo "* set htop at your convenience" echo "* set htop at your convenience"
echo "* remove password for sudo" # TODO we should automate that, with a flag echo "* remove password for sudo" # TODO we should automate that, with a flag
echo "* use below commands to edit SSH config:"
echo " sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config"
echo " sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config"
exit 0 exit 0