copy user to bsd.tilde.team at creation

This commit is contained in:
Ben Harris 2022-03-25 11:26:31 -04:00
parent c85dacc84c
commit 71aa43583c
1 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,7 @@ case $1 in
fi
printf "adding new user %s\n" "$1"
newpw=$(pwgen -1B 10)
newpw=$(pwgen -1B 20)
sudo useradd -m -g 100 -s /bin/bash "$1" \
|| error_exit "couldn't add user"
printf "%s:%s\n" "$1" "$newpw" | sudo chpasswd
@ -67,5 +67,9 @@ case $1 in
printf "applying disk quota\n"
sudo setquota -u "$1" 1048576 3145728 0 0 /home
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
;;
esac