Secure Shell (SSH) is a cryptographic network for operating network services securely over an unsecured network. A common example is for remote login into a system by an user.
Generally it comes already installed in most of the Linux distributions. Or otherwise you can install it with the following command in your terminal. I'm writing here shell scripts for Ubuntu. You may find some syntax change for other distributions but steps are similar.
sudo apt-get install openssh-server
Generate PEM file :
If you get chance to work on AWS, you get a pem file to login into your dedicated/virtual server with the ssh with -i parameter.
You also can generate the PEM file for your system so that you/your client can login into you machine remotely. To generate the PEM file follow the steps given below.
Generate the PEM and PUB files with the following shell script. Enter this command to generate 2,048 bit RSA key using verbose (questions asked during) mode, and a public .pem X.509 certificate.
ssh-keygen -t rsa -b 2048 -v
You will be asked for a file name, I inserted a name my_pem, it will generate a my_pem.pub file and the my_pem file without file extension, rename it to my_pem.pem, files are created in the current directory you have open in terminal window. You will be asked to enter passphrase, it is for securing the certificate on your local machine, I ignored this option by pressing enter, as it is voluntary option and I feel confident about my local computer security.
Now it done but when you try with this PEM file, it asks for the password. To fix that, upload the secured key into your openssh server with the following shell script.