Created
October 29, 2010 03:10
-
-
Save coto/652818 to your computer and use it in GitHub Desktop.
Create & Upload a RSA Key for Github and others
This file contains hidden or 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
mkdir -p ~/.ssh | |
ssh-keygen -t rsa -C "[email protected]" | |
scp -P $port ~/.ssh/id_rsa.pub $user@$ip:/$folder/ | |
echo "===================================================================" | |
echo "============= Local Key ===============" | |
echo "===================================================================" | |
cat ~/.ssh/id_rsa.pub | |
echo "===================================================================" | |
echo "============= Remote ===============" | |
echo "===================================================================" | |
echo -e "Put this on remote:\n\t" | |
mkdir -p /$folder/.ssh; | |
mv -f /$folder/id_rsa.pub /$folder/.ssh/authorized_keys; | |
chown -R $user:$user /$folder/.ssh; | |
chmod 700 /$folder/.ssh; chmod 600 /$folder/.ssh/* | |
echo -e "\n\tcat /$folder/.ssh/authorized_keys" | |
echo "===================================================================" | |
ssh -p $port $user@$ip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment