infra/codestorage/hg-ssh

Paddy 2015-08-17 Child:121585c71fd7

0:eeaf3e97ed44 Go to Latest

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.

History
paddy@0 1 #/bin/bash
paddy@0 2
paddy@0 3 USERNAME=$1
paddy@0 4 IDS=$2
paddy@0 5
paddy@0 6 adduser --disabled-password --gecos "" -u $IDS $USERNAME
paddy@0 7 mkdir -p /home/$USERNAME/.ssh && touch /home/$USERNAME/.ssh/authorized_keys
paddy@0 8 chmod 0700 /home/$USERNAME/.ssh && chmod 0600 /home/$USERNAME/.ssh/authorized_keys
paddy@0 9 chown -R $USERNAME:$USERNAME /home/$USERNAME/.ssh
paddy@0 10 usermod -g 2000 $USERNAME
paddy@0 11
paddy@0 12 ln -s /mounted/repos /home/$USERNAME/repos