13,420
edits
Changes
no edit summary
After performing lab7 in OPS235, you should have a basic understanding of ssh and public/private key cryptography to create secure connections between servers.
The public key can be "shared" with other server accounts, etc and used in conjunction with your private key in order to help encrypt/de-crypt data.
The diagram displayed to the right is shared from [http://sebastien.saunier.me/blog/2015/05/10/github-public-key-authentication.html Sébastien Saunier's blog].
It demonstrates how SSH key authentication works. It's not a complete diagram, but it helps see all the parts of ssh key authentication in one place.
==== Public/Private key pair ====
<source lang="bash">ssh-keygen -t rsa</source>
When issuing this commancommand, you will end up with the files: '''~/.ssh/id_rsa''' and '''~/.ss/id_rsa.pub''' (private and public keys) ==== Sharing your Public key on a Remote server ==== So far, this is a general repeat of OPS235 lab7... What you may '''<u>not</u>''' know is that by using a '''"trick"''' (the ''magic'' of public key cryptography), you can SSH to a Linux machine without using a password!Learning to perform this trick is <u>'''essential'''</u> in this course and in the industry in general. SSH keys are used everywhere that Linux servers are used.
You can do this two ways:<ul><li>Copy contents of your '''~/.ssh/id_rsa.pub''' from your host machine, and append the contents to '''~/.ssh/authorized_keys''' on each of your Virtual Machine servers</li><li>Issue the command:<br><source lang="bash">ssh-copy-id -i ~/.ssh/id_rsa.pub username@server</source><br></li></ul>