Getting Started with SSH
Chapters
In this short course we will explore what SSH is. This course is split into multiple parts such as
- Introduction to SSH
- Generating a Key Pair to make connections
- Accessing remote servers using SSH client
- Various scenarios SSH can be used in
- Installing SSH server
Primary objective of this course is to get you up and running with SSH.
We hope that you will enjoy this short course.
Author: Subject Coach
Added on: 4th Jan 2015
Please get in touch with your teacher or tutor in case you have a question related to this lesson
None just yet!
In Linux, You will use SSH dash key gen command to create a private public key pair.
We specify dash t option to tell SSH key gen to use RSA algorithm, when generating key pairs.
Type in SSH key gen command and press enter.
You are now asked where to save your keys. I will leave the default path as it is.
You are now asked for the pass phrase for the private key.
Enter the pass phrase and press enter.
confirm the pass phrase and press enter.
Random art shows up, randomart is an easier way for us humans to validate keys.
Change directory to where we stored our private and public keys.
ID underscore RSA dot pub, is our public key.
ID underscore RSA is our private key.
We have to copy our public key to our remote server authorized underscore keys file.
There are multiple ways of doing this.
First let's use SSH dash copy dash ID program to copy it across, this tool will automatically append our public key to authorized underscore keys file.
Now let's login using our private key.
dash i option provides a path to the private key.
you are now asked for the private key pass phrase. Press enter when done.
We are in!
Let's check the second method, where we will use secure file transfer using SCP.
First I will remove my existing key from authorized underscore keys file.
I will now try to login again from my source Linux machine to see if I can still get in using my private key. You will observe that login process falls back to password authentication.
Let's now copy our public key to a folder at our remote server.
Now let's access our remote server shell.
Our public key will be saved at the path we mentioned earlier.
Let's append this key to authorized underscore keys file.
exit from this session.
Now try again to login using the private key.
you will now be asked for a pass phrase for the key.
Enter it and press enter.
That's it! we are in.
In next chapter, i will show you how to block password based SSH access to our remote server.