ensure .ssh/config and .ssh/authorized_keys
authorAJ ONeal <aj@therootcompany.com>
Fri, 26 Jun 2020 07:37:24 +0000 (07:37 +0000)
committerAJ ONeal <aj@therootcompany.com>
Fri, 26 Jun 2020 07:37:24 +0000 (07:37 +0000)
ssh-utils/ssh-adduser.sh
ssh-utils/ssh-pubkey.sh

index e6c71126f612a60d17994a3783c17dd29c6caf40..621e31447a4a59e8f4fff2f307e72e52327ce56a 100644 (file)
@@ -31,6 +31,8 @@
     chmod 0700 /home/me/.ssh/
     cp -r "$HOME/.ssh/authorized_keys" /home/me/.ssh/
     chmod 0600 /home/me/.ssh/authorized_keys
+    touch /home/me/.ssh/config
+    chmod 0644 /home/me/.ssh/config
     chown -R me:me /home/me/.ssh/
 
     # ensure that 'me' has an SSH Keypair
index 074a098452cc896438e9e6cfc956ec4b57dada5b..588dcca307f8e859683e1e5f45d6fd8748078ef3 100644 (file)
@@ -9,6 +9,17 @@
         chmod 0700 "$HOME/.ssh/"
     fi
 
+    if [ ! -f "$HOME/.ssh/config" ]; then
+        # for the benefit of VSCode
+        touch "$HOME/.ssh/config"
+        chmod 0644 "$HOME/.ssh/config"
+    fi
+
+    if [ ! -f "$HOME/.ssh/authorized_keys" ]; then
+        touch "$HOME/.ssh/authorized_keys"
+        chmod 0600 "$HOME/.ssh/authorized_keys"
+    fi
+
     if [ ! -f "$HOME/.ssh/id_rsa" ]; then
         ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
         echo ""