diff --git a/newuser.sh b/newuser.sh index bfbe5a2..f2475e2 100755 --- a/newuser.sh +++ b/newuser.sh @@ -1,5 +1,6 @@ #!/bin/sh SLBRUSER=$1 +PUBKEY=$2 test -z "$SLBRUSER" && echo "no user provided" && exit echo "Creating homedir..." @@ -14,3 +15,5 @@ sudo chown "$SLBRUSER:$SLBRUSER" "/home/slbr/$SLBRUSER" sudo chsh "$SLBRUSER" -s /home/slbr/login.sh echo "Creating container..." sudo su "$SLBRUSER" -s /bin/sh -c "/home/slbr/lxcinit.sh" +mkdir "/home/slbr/$SLBRUSER/.ssh" +echo "$PUBKEY" >> "/home/slbr/$SLBRUSER/.ssh/authorized_keys"