Skip to content

Instantly share code, notes, and snippets.

@GeorgeNance
Last active February 17, 2020 19:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeorgeNance/2a00ab91f225c84ae89b1abbbbbcb489 to your computer and use it in GitHub Desktop.
Save GeorgeNance/2a00ab91f225c84ae89b1abbbbbcb489 to your computer and use it in GitHub Desktop.
#!/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