ensure .ssh/config and .ssh/authorized_keys

This commit is contained in:
AJ ONeal
2020-06-26 07:37:24 +00:00
parent 13d30cd4c7
commit 287427af94
2 changed files with 13 additions and 0 deletions
+2
View 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
+11
View 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 ""