Public Cloud > Virtual Data Center > SSH keys > Generating an SSH key on Windows and Linux computers

1.2 Generating an SSH key on Windows and Linux computers

How to generate an SSH key from a Windows computer with PuTTYgen

  • Download the PuTTYgen client;
  • launch the program;
  • in the Parameters section, select the key type from those accepted by Aruba Cloud: RSA, DSA, or ECDSA;
  • in the Number of bits in a generated key field, enter a recommended value (for example, 2048 or 4096 bits for RSA);
  • select the Generate button;
  • move the cursor randomly on the client screen until the progress bar is complete;
  • you can edit the Key comment, which is automatically filled in (e.g., rsa-key-20250505);
  • if you want to protect your private key with a password, enter a passphrase in the Key passphrase and Confirm passphrase fields;
    • if you set a passphrase, you will need to enter it each time you use your private key;
  • save your public key (.pub) and private key (.ppk) using the Save public key and Save private key buttons.

How to generate an SSH key from a Windows computer with OpenSSH

  • Open PowerShell as administrator:
    • from Start, search for Windows PowerShell and select Run as administrator;
  • you can choose to create an SSH key automatically or specify a type and description:
    • to create an SSH key automatically, type the following command and press enter;

      ssh-keygen

    • if you want to choose the SSH key type, length and add a description, type the following command and press enter:

      ssh-keygen -t rsa -b 4096 -C "descrizione-opzionale"

      • -t is used to specify the SSH key type;
      • -b is used to specify the SSH key length in bits;
      • -C is used to add a comment to the SSH key;
  • you will be shown the path to save your SSH key which by default is:

    C:\Users\username/.ssh/id_rsa

    • if you want to keep the default path, press enter;
    • if you want to change it, type the full path, including the file name without the extension, for example:

      C:\Users\username/security/ssh-key

  • you will be asked if you want to protect the private key with a password:

    Enter passphrase (empty for no passphrase):

    • if you don't want to enter it, press Enter twice;
    • if you choose to enter it, you'll be asked to type it a second time to confirm, then press enter;

      Enter same passphrase again:

  • two files will be created in the folder you specified:
    • the private key id_rsa which contains the private key;
    • the public key id_rsa.pub which contains the private key;
  • if you left the default path, the files will be located in C:\Users\username/.ssh/.

How to generate an SSH key from a Linux computer using the terminal

  • Open the terminal on your Linux computer;
  • you can choose to create an SSH key automatically or specify the type and description:
    • to create an SSH key automatically, type the following command and press enter:

      ssh-keygen

    • if you want to choose the SSH key type, length, and add a description, type the following command and press Enter:

      ssh-keygen -t rsa -b 4096 -C "description-optional"

      • -t is used to specify the SSH key type;
      • -b is used to specify the SSH key length in bits;
      • -C is used to add a comment to the SSH key;
  • you will be shown the path to save your SSH key which by default is:

    C:\Users\username/.ssh/id_rsa

    • if you want to keep the default path, press enter;
    • if you want to change it, type the full path, including the file name without the extension, for example:

      C:\Users\username/security/ssh-key

  • you will be asked if you want to protect the private key with a password:

    Enter passphrase (empty for no passphrase):

    • if you don't want to enter it, press Enter twice;
    • if you choose to enter it, you'll be asked to type it a second time to confirm, then press enter;

      Enter same passphrase again:

  • two files will be created in the folder you specified:
    • the private key id_rsa which contains the private key;
    • the public key id_rsa.pub which contains the private key;
  • if you left the default path, the files will be located in /home/username/.ssh/.