1. Home
  2. Web Hosting
  3. Generate an SSH key
  1. Home
  2. Dedicated accommodations
  3. Generate an SSH key

Generate an SSH key

Why generate an SSH key?

The public SSH key authentication method has many advantages.
The idea is to set up a tunnel between a client and a server that guarantees secure transactions.
The digital fingerprint of the used password is saved on the public SSH key.
The private SSH key is stored on the personal computer and therefore remains secret.
Even if unauthorized third parties manage to gain access to the public key, it would be almost impossible for them to decrypt the private key.
Thus, by using an SSH connection with a private and a public key, you guarantee maximum security for your data.

Generate an SSH key under WINDOWS

1. Press the Windows key + r on your keyboard at the same time, to open the Run window,
2. Put cmd in the input field and click on OK,
3. Move (if it is not the case) in the path C:\UsersYourUserNameWindows, via the command cd %userprofile%,
4. Run the following commands respectively:
mkdir .ssh
cd .ssh
ssh-keygen
Put the file name in which the key will be inserted
Put your passphrase (twice)

You can also run the same commands using PowerShell.

Then go to the .ssh folder created under the C:UserYourUserNameWindows directory. You will see two files in it. One that contains the private key, the other contains the public key.
Open the file mondomainekey.pub (which contains the public key) with NotePad or Notepad or another text editor. Copy the key that starts with ssh-rsa, and ends with YourUserName@YourUserNameWindows.
The key must not contain any line breaks.

Generate an SSH key under Mac OS

Open a terminal and run the following command:
ssh-keygen -t rsa -C votreadresse@mail.tld
then
cat /Users/myuser/.ssh/id_rsa.pub to get the public key.

Generating an SSH key under LINUX

All you need to do is :
1. Run the ssh-keygen command on a terminal,
2. Put the name of the file in which the key will be inserted,
3. Put in your passphrase (twice),
4. Run the cat filename.pub command to copy the generated public key.

The key must not contain any line breaks.

Updated on 22 March 2021

Related Articles

Leave a Comment