Last active
August 29, 2015 14:09
-
-
Save paulallies/ae7863f9e097cdd5f321 to your computer and use it in GitHub Desktop.
Multi Hop SSH
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
#Generate Local Key Pair | |
[paul@pauls_mac paul]$ ssh-keygen | |
Output: | |
Generating public/private rsa1 key pair. | |
Enter file in which to save the key (/home/paul/.ssh/id_rsa): /home/paul/.ssh/id_rsa | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in /home/paul/.ssh/id_rsa. | |
Your public key has been saved in /home/paul/.ssh/id_rsa.pub. | |
The key fingerprint is: | |
22:bc:0b:fe:f5:06:1d:c0:05:ea:59:09:e3:07:8a:8c paul@pauls_mac | |
#Place public key on remote server | |
[paul@pauls_mac paul]$ cd .ssh/ | |
[paul@pauls_mac .ssh]$ scp id_rsa.pub paul@server:./id_rsa.pub | |
id_rsa.pub 100% |*****************************************************| 526 00:00 | |
#Create files and folders on server | |
[paul@server paul]$ mkdir .ssh | |
[paul@server paul]$ chmod 700 .ssh | |
[paul@server paul]$ cd .ssh | |
[paul@server .ssh]$ touch authorized_keys | |
[paul@server .ssh]$ chmod 600 authorized_keys | |
[paul@server .ssh]$ cat ../id_rsa.pub >> authorized_keys | |
[dave@server .ssh]$ rm ../id_rsa.pub | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment