Frequently Asked Question

How to create SSH keys?
Last Updated 3 years ago

1. Introduction

This guide shows how to generate SSH keys on Linux and Windows using a few different methods. A key consists of the public key and the private key. The public key may be shared and, by default, has the .pub extension. After SSH Keys are generated, please make sure to send the PUBLIC KEY to EODC. Until then you won't be able to access any Virtual Machine.

2. Generate an SSH key on Linux

Open a terminal and run the following command and follow the instructions.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

This will generate a new SSH Key

> Generating public/private rsa key pair.
  • When prompted to "Enter a file in which to save the key", press Enter.
  • The keys are stored in "/home/$USER/.ssh" by default.
  • When prompted add a secure "Passphrase" and make sure to note it down.
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]

Do not ever share your private key with others!

3. Generate an SSH key on Windows

On Windows there are several methods of installing OpenSSH and generating SSH keys. Windows 10 Version 1809 and higher have OpenSSH as an integrated feature that has to be enabled in the system settings.

For an older version of Windows, a third-party SSH client has to be installed.
In this guide we will focus on the following methods:

  • Using OpenSSH on Windows 10
  • Using PuTTY
  • Using MobaXterm

3.1. Using OpenSSH on Windows 10

Make sure OpenSSH is enabled on your Windows 10 system. This feature will only work on Windows 10 Version 1809 and above.

If OpenSSH is not enabled head over to this guide: How to install OpenSSH on Windows 10?

  • Open Powershell or CMD and type in the following command:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

This will generate a new SSH Key

> Generating public/private rsa key pair.
  • When prompted to "Enter a file in which to save the key", press Enter.
  • The keys are stored in "C:\Users%USERNAME%.ssh" by default.
  • When prompted add a secure "Passphrase" and make sure to note it down.
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]

Do not ever share your private key with others!

3.2. Using MobaXterm

Mobaxterm is an enhanced terminal for Windows with X11 server, tabbed SSH client, network tools, and much more.
You can download it here: https://mobaxterm.mobatek.net/

If you are not allowed to install software on your computer you can download the portable version. How to install portable versions?

  • Download and unzip the installer
  • Make sure that "MobaXterm_installer.dat" and "MobaXterm_installer_**.*.msi" are saved in the same location.
image
  • Allow access on the Windows Defender Firewall prompt
image


Make sure that the option "Public networks" is not selected!

  • In the top navigation bar click on tools and select "MobaKeyGen (SSH key generator)" from the dropdown menu.
image



  • Click “Generate” and move the cursor in the highlighted box
image
image

We recommend to use RSA type for maximum compatibility
N.B "SSH-1 (RSA)" is typically unsupported.

  • Add a secure "Passphrase" and make sure to note it down.
  • Save both keys by clicking "Save public key" and "Save private key"



image

3.3. Using Putty

Download PuTTy from http://putty.org
If you are not allowed to install software on your computer, you can also use the portable version. How to install portable versions?

image



  • Click “Generate” and move the cursor in the highlighted box
image

We recommend to use RSA type for maximum compatibility
N.B "SSH-1 (RSA)" is typically unsupported.

image



  • Add a secure "Passphrase" and make sure to note it down.
  • Save both keys by clicking "Save public key" and "Save private key"
image

  • Copy the content of 'Public key for pasting into OpenSSH authorized_keys file' and save it for later usage. This is the preferred Format for SSH keys as it is required for Openstack and VM's  

Do not share your private Key with other people!

This website relies on temporary cookies to function, but no personal data is ever stored in the cookies. For further information see our

privacy policy.

Accept

Loading ...