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
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/create_user.sh	Mon Aug 17 19:07:28 2015 -0400
     1.3 @@ -0,0 +1,12 @@
     1.4 +#/bin/bash
     1.5 +
     1.6 +USERNAME=$1
     1.7 +IDS=$2
     1.8 +
     1.9 +adduser --disabled-password --gecos "" -u $IDS $USERNAME
    1.10 +mkdir -p /home/$USERNAME/.ssh && touch /home/$USERNAME/.ssh/authorized_keys
    1.11 +chmod 0700 /home/$USERNAME/.ssh && chmod 0600 /home/$USERNAME/.ssh/authorized_keys
    1.12 +chown -R $USERNAME:$USERNAME /home/$USERNAME/.ssh
    1.13 +usermod -g 2000 $USERNAME
    1.14 +
    1.15 +ln -s /mounted/repos /home/$USERNAME/repos