From 0f4d0cbc8fedd8292cd49d5327519473e4a4ac50 Mon Sep 17 00:00:00 2001 From: Matt Troutman Date: Mon, 26 Aug 2024 10:43:09 -0500 Subject: [PATCH] Adding RSA public key & install script --- key_install.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) mode change 100644 => 100755 key_install.sh diff --git a/key_install.sh b/key_install.sh old mode 100644 new mode 100755 index e69de29..59b4943 --- a/key_install.sh +++ b/key_install.sh @@ -0,0 +1,21 @@ +# /bin/sh + +# Check for .ssh directory +if [ ! -d ~/.ssh ]; then + mkdir ~/.ssh + chmod 700 ~/.ssh +fi + +# Check for authorized_keys file +if [ ! -f ~/.ssh/authorized_keys ]; then + touch ~/.ssh/authorized_keys + chmod 600 ~/.ssh/authorized_keys +fi + +# Add public key to authorized_keys file +echo ./id_rsa.pub >> ~/.ssh/authorized_keys + + + +# Exit +exit 0