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.
| paddy@2 | 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 |