infra/codestorage/hg-ssh
2015-10-14
Parent:121585c71fd7
infra/codestorage/hg-ssh/create_user.sh
Set trust settings to avoid annoying message. Update the hgrc to trust the .hgrc files of everyone in the committers group, because I got tired of seeing the "not trusting file /mounted/repos/blah-blah/.hg/hgrc from untrusted user root, group committers" message every time I pushed.
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