Linux Mint

Generate SSH Keys on Linux Mint 21

SSH or secure shell come in handy when one needs to remotely access a system as the user password authentication method seems to be more vulnerable in terms of security. The SSH system is a client server-based model that uses port 22 by default but this port can be changed if one is concerned more about security. To access any system remotely one needs to generate SSH keys first on the system through which you will access the other system, so read this guide to generate SSH keys on Linux Mint 21.

What are SSH Keys

As mentioned above, secure shell keys are the keys used to authenticate the connection between two devices as the SSH method is based on the client server model. There are mainly two keys required to establish a connection between two devices; one is a public key that is to be shared with the system that is being accessed remotely. The other key is the private key that is used by the client system to decrypt the messages received from the remote system or server.

Generating SSH Keys on Linux Mint 21

Generating SSH keys on Linux Mint 21 is an easy process if one follows the below mentioned steps:

Step 1: To start the SSH key generating process use the below given command and give a name to the key file:

$ ssh-keygen

Step 2: Next enter the security key that is easy to remember as there is no option of setting an new password for the same file if you forget the password:

Graphical user interface, text, application Description automatically generated

Now re-enter the password:

Text Description automatically generated

Once both the password matches the SSH key will be generated:

Text Description automatically generated

Now you can check if the SSH key is generated or not using the ls command, remember that there are two files created when the SSH key is generated one is a public key that will be shared to the system you are accessing.

Whereas the other is the private key that must not be shared with anyone as the system will decrypt the message from the server using private key:

To view your SSH public key use:

$ cat key1.pub

Conclusion

SSH keys are sort of authentication keys used to access other systems remotely in a more secure way. There are mainly two keys required to establish a connection between two devices; one is a public key that is to be shared with the system which is being accessed remotely. The other key is the private key that is used by the client system to decrypt the messages received from the remote system or server.

About the author

Aaliyan Javaid

I am an electrical engineer and a technical blogger. My keen interest in embedded systems has led me to write and share my knowledge about them.