infra/codestorage/hg-ssh
2015-08-17
Child:121585c71fd7
infra/codestorage/hg-ssh/create_user.sh
Initial commit. This hardcodes more than it should and syncs with Google Cloud Storage more than is really necessary, but it A) works and B) is currently on code.secondbit.org, so that should probably be recorded for posterity.
1 #/bin/bash
3 USERNAME=$1
4 IDS=$2
6 adduser --disabled-password --gecos "" -u $IDS $USERNAME
7 mkdir -p /home/$USERNAME/.ssh && touch /home/$USERNAME/.ssh/authorized_keys
8 chmod 0700 /home/$USERNAME/.ssh && chmod 0600 /home/$USERNAME/.ssh/authorized_keys
9 chown -R $USERNAME:$USERNAME /home/$USERNAME/.ssh
10 usermod -g 2000 $USERNAME
12 ln -s /mounted/repos /home/$USERNAME/repos