Last active
February 17, 2020 19:38
-
-
Save GeorgeNance/2a00ab91f225c84ae89b1abbbbbcb489 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add_ssh_key - A script to move ssh key and set permissions | |
##### Constants | |
SSH_DIR=~/.ssh/ | |
# Check for path | |
if [ -z "$1" ]; then | |
echo "Please provide the path to the ssh key" | |
exit 1 | |
fi | |
cp $1 $SSH_DIR | |
chmod 600 $SSH_DIR$(basename $1) | |
echo "Copied ${1} to .ssh dir and set permissions to 600" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment