Skip to content

Instantly share code, notes, and snippets.

@GeorgeNance
Last active January 24, 2025 16:26
Show Gist options
  • 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