#!/bin/bash

USERNAME=$1
IDS=$2

adduser --disabled-password --gecos "" -u $IDS $USERNAME
mkdir -p /home/$USERNAME/.ssh && touch /home/$USERNAME/.ssh/authorized_keys
chmod 0700 /home/$USERNAME/.ssh && chmod 0600 /home/$USERNAME/.ssh/authorized_keys
chown -R $USERNAME:$USERNAME /home/$USERNAME/.ssh
usermod -g 2000 $USERNAME

ln -s /mounted/repos /home/$USERNAME/repos
