Laying groundwork for ssh keys

This commit is contained in:
oneseveneight 2018-09-19 08:49:44 -07:00
parent cedf62e267
commit 34df2ba5bc
1 changed files with 3 additions and 0 deletions

View File

@ -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"