actually copy the ssh key over

This commit is contained in:
Ben Harris 2022-04-20 18:18:54 -04:00
parent 71aa43583c
commit 1ad3722bab
1 changed files with 3 additions and 0 deletions

View File

@ -71,5 +71,8 @@ case $1 in
printf "copying user to bsd.tilde.team\n"
newid=$(id -u "$1")
printf %s "$newpw" | sudo ssh bsd.tilde.team -- pw useradd -n "$1" -u "$newid" -g team -md /home/"$1" -h0
sudo ssh bsd.tilde.team -- mkdir -p /home/"$1"/.ssh
printf "%s\n" "$3" | sudo ssh bsd.tilde.team -- tee /home/"$1"/.ssh/authorized_keys
sudo ssh bsd.tilde.team -- chown -R "$1":team /home/"$1"/.ssh
;;
esac