X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=ssh-utils%2Fssh-pubkey.sh;h=588dcca307f8e859683e1e5f45d6fd8748078ef3;hb=59074b5d9d0a9f03a0f525011a3cbd37428347c4;hp=9f0722911b6ee68640012814bf885f2b60aa580b;hpb=2d4cc2a75db4fcaec63afa48a3fec3be3a0732b8;p=webi-installers%2F.git diff --git a/ssh-utils/ssh-pubkey.sh b/ssh-utils/ssh-pubkey.sh index 9f07229..588dcca 100644 --- a/ssh-utils/ssh-pubkey.sh +++ b/ssh-utils/ssh-pubkey.sh @@ -4,7 +4,21 @@ set -e set -u - mkdir -p "$HOME/.ssh/" + if [ ! -d "$HOME/.ssh" ]; then + mkdir -p "$HOME/.ssh/" + 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 ""