From 34df2ba5bc108d40797274056340c7d37d21aaf5 Mon Sep 17 00:00:00 2001 From: oneseveneight Date: Wed, 19 Sep 2018 08:49:44 -0700 Subject: [PATCH] Laying groundwork for ssh keys --- newuser.sh | 3 +++ 1 file changed, 3 insertions(+) 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"