From fcf6800422aacd54922c6c4486a3b32f0ffb2c25 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 1 Nov 2015 10:03:26 +0000 Subject: [PATCH] Ownership of ssh directory --- src/freedombone-adduser | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/freedombone-adduser b/src/freedombone-adduser index 334e518d..ec463422 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -35,11 +35,13 @@ if [ "$SSH_PUBLIC_KEY" ]; then if [ -f "$SSH_PUBLIC_KEY" ]; then mkdir /home/$MY_USERNAME/.ssh cp $SSH_PUBLIC_KEY /home/$MY_USERNAME/.ssh/authorized_keys + chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh echo 'ssh public key installed' else if [[ "$SSH_PUBLIC_KEY" == "ssh-"* ]]; then mkdir /home/$MY_USERNAME/.ssh echo "$SSH_PUBLIC_KEY" > /home/$MY_USERNAME/.ssh/authorized_keys + chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.ssh echo 'ssh public key installed' else echo 'The second parameter does not look like an ssh key'