X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/form?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Finit_user_login.sh;h=aa8a03f6b090c076f6bbec57fda41bfeec004174;hb=af7fbe96d9af13e1a5d2485351f5ca4ce2cf3ccd;hp=78a891b95b2b0ee43798d7792fd1f0b04bc1ad64;hpb=84a4ad59ae43f71230485fe43be35df39f147890;p=config diff --git a/bookworm/setup_scripts/init_user_login.sh b/bookworm/setup_scripts/init_user_login.sh index 78a891b..aa8a03f 100755 --- a/bookworm/setup_scripts/init_user_login.sh +++ b/bookworm/setup_scripts/init_user_login.sh @@ -7,7 +7,6 @@ # # Dependencies: ssh, scp, properly configured sshd_config file in reach. set -e -set -x . ./misc.sh # Location of an sshd_config with "PermitRootLogin no" and @@ -23,16 +22,16 @@ server="$1" 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}"