An SSH Key is a secure authentication method that allows you to connect to your cloud servers without having to use a password. This authentication method needs to use a Private Key and a Public Key.
These keys can be configured in many ways, but generally the cipher you will use is one called 2048 Bit RSA -which is similar to a password of about 617 digits-.
Below we explain what SSH Keys are and how they work.
Private SSH Key and Public SSH Key
In an SSH key the two main components are the public key and the private key. Both keys are important, but one of them will be the one you will share and the other one must be stored (and you must never share it).
- Private Key: You will have to generate this key in your local computer and it will be the one that will allow you to connect to the servers that have the Public Key that you generate from your Private Key.
- Public Key: This key will be the one you copy to your server to be able to access with your Private Key.
When a server is configured to access with SSH key, the Public Key must be copied to that server. This key can only be opened with the Private Key with which it was created. Therefore, the Private Key must be stored in a safe place.
The use of SSH keys can only be used in images where the base operating system is GNU/Linux. On Windows it is not common to use SSH keys to connect.
How to use your SSH keys on Linux, Window and Mac OS
If you need to know how to generate an SSH key and how to connect to the server using the SSH keys created locally, we leave you these articles depending on the operating system you use.
- If your operating system is GNU/Linux you should follow this specific tutorial.
- If your operating system is Windows you should follow these other instructions.
- Finally, if your operating system is Mac OS you should follow this step by step tutorial.
We hope we have solved your doubts with this tutorial. Do you have more questions? Write us at email@example.com We are here to help you! 😉