X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Finit_user_login.sh;h=820b5abf60ca191d02ed8f1457e7043a26dd1681;hb=8e3009abbe64ed44da8e9be0a14427c73237cc16;hp=8413cd842e1c2728cde7f474b583a2e12770a3d0;hpb=d286a9a87d1cf888716bb7e36f7cbc052e75ff31;p=config diff --git a/bookworm/setup_scripts/init_user_login.sh b/bookworm/setup_scripts/init_user_login.sh index 8413cd8..820b5ab 100755 --- a/bookworm/setup_scripts/init_user_login.sh +++ b/bookworm/setup_scripts/init_user_login.sh @@ -18,20 +18,23 @@ local_path_sshd_config="${linkable_files_dir}${system_path_sshd_config}" expect_n_args 1 "(server)" "$@" server="$1" +# If we already knew that host … +ssh-keygen -f "/home/plom/.ssh/known_hosts" -R "${server}" + # So we're only asked once … eval $(ssh-agent) ssh-add -# # This will be used to log-in as root from plom account. -# echo 'Asking for new root password.' -# ssh root@"${server}" "passwd" -# -# # Set up plom's ~/.ssh/authorized_keys from root's. -# ssh root@"${server}" 'useradd -m plom' -# ssh root@"${server}" 'mkdir /home/plom/.ssh' -# ssh root@"${server}" 'chown plom:plom /home/plom/.ssh' -# ssh root@"${server}" 'cp /root/.ssh/authorized_keys /home/plom/.ssh/' -# ssh root@"${server}" 'chown plom:plom /home/plom/.ssh/authorized_keys' +# This will be used to log-in as root from plom account. +echo 'Asking for new root password.' +ssh root@"${server}" "passwd" + +# Set up plom's ~/.ssh/authorized_keys from root's. +ssh root@"${server}" 'useradd -m plom' +ssh root@"${server}" 'mkdir /home/plom/.ssh' +ssh root@"${server}" 'chown plom:plom /home/plom/.ssh' +ssh root@"${server}" 'cp /root/.ssh/authorized_keys /home/plom/.ssh/' +ssh root@"${server}" 'chown plom:plom /home/plom/.ssh/authorized_keys' # Set up SSH config and remove direct SSH login to root. scp "${local_path_sshd_config}" root@"${server}":"${system_path_sshd_config}"