Adding RSA public key & install script
This commit is contained in:
parent
5aca581a40
commit
0f4d0cbc8f
21
key_install.sh
Normal file → Executable file
21
key_install.sh
Normal file → Executable file
|
@ -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
|
Loading…
Reference in New Issue
Block a user