1,234
edits
Changes
→Investigation 3: How do you establish an ssh connection using Public Key Authentication.
=== Investigation 3: How do you establish an ssh connection using Public Key Authentication. ===
{{Admon/note | Use your fedora2 centos2 VM | Complete this investigation on your fedora2 centos2 VM.}}
{{Admon/note | | '''Public Key authentication''' is a method of establishing identity using a pair of encryption keys that are designed to work together. One key is known as your private key (which as the name suggests should remain private and protected) and the other is known as the public key. (which as the name suggests can be freely distributed) The keys are designed to work together to encrypt data asymmetrically, that is to say that when we encrypt data with one of the keys it can only be decrypted with the other key from the pair. This means that when we connect, ssh can use the private key that only exists on my system in my account, to encrypt a message. That message can be decrypted by anybody with the corresponding public key. While it doesn't mean the message is secure as anybody could decrypt it with the public key, it does establish my identity, if the host can successfully decrypt the message then it must have come from the one person in possession of the private key. This basic method of authentication is used extensively in many network communications protocols that require the ability to authenticate identity.}}
# Start by generating a keypair as your learn account on fedora2 centos2 using the command:<br /><code>ssh-keygen</code>
# That should generate output similar to the following:
<pre>
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.
The key fingerprint is:
93:58:20:56:72:d7:bd:14:86:9f:42:aa:82:3d:f8:e5 user1@fedora2centos2</pre>
<ol><li value="3"> After generating the keys it prompts you for the location to save the keys. The default is <code>~/.ssh</code> Your private key will be saved as <code>id_rsa</code> and your public key will be saved as <code>id_rsa.pub</code></li></ol>
{{Admon/tip | Lengthy Passphrases | You will then be prompted for a passphrase. The passphrase must be entered in order to use your private key. Passphrases are more secure than passwords and should be lengthy, hard to guess and easy to remember. For example one passphrase that meets this criteria might be "seneca students like fish at 4:00am". Avoid famous phrases such as "to be or not to be" as they are easy to guess. It is possible to leave the passphrase blank but this is dangerous. It means that if a hacker were able to get into your account they could then use your private key to access other systems you use.}}
</ol>