Skip to main content
SSH key pairs authenticate connections to Linux Virtual Instances — a public key is stored in the Gcore Customer Portal and a private key remains on the local machine.

Generate SSH keys

SSH keys can be generated in the Customer Portal or via CLI tools and SSH clients:
Never share a private SSH key or password with third parties. Doing so may result in unauthorized access to a Virtual Instance and the compromise of any sensitive information stored there.

Generate SSH keys in the customer portal

SSH keys can be created when creating a Virtual Instance or generated separately in the SSH Keys section. After generation, the public key is added to the system and appears in the SSH Keys section alongside any other keys. The private key is downloaded to local storage.
Public key names can contain only Latin characters, underscores, spaces, and dots. The length must be between 3 and 63 characters.
When creating a Virtual Instance, the SSH key section offers a dropdown to select an existing key and links to add or generate a new key.
  • Select ssh key — add a key already stored in the Gcore Customer Portal by selecting it from the dropdown list.
  • add a new SSH Key — add an existing key generated via CLI tools or an SSH client.
  • generate a SSH Key — create a new key pair in the portal.
SSH key section with a dropdown and links to add or generate a key
To use the generate a SSH Key option:
  1. Click the generate a SSH Key link.
  2. In the dialog that opens, enter the key name to identify the key in the system.
  3. Click Create SSH Key — the browser downloads the private key file to local storage.
Autogenerate SSH Key dialog with name field and Create SSH Key button

Generate SSH keys via CLI tools or SSH clients

To generate SSH keys on Linux, macOS, or Windows 10/11 devices:
  1. Open Terminal (Linux, macOS) or Command Prompt (cmd.exe on Windows).
  2. Run the following command to generate a key pair:
ssh-keygen -t rsa -b 2048
  1. When prompted for the file path, specify a custom location (for example, .ssh/) or press Enter to save the keys to the default directory. The default directory is ~/.ssh/ for Linux/macOS and C:\Users\{username}\.ssh\ for Windows.
  2. When prompted for a passphrase, enter a password for additional security or leave the field empty and press Enter to create the key without a password.
  3. Confirm the passphrase by entering it again, or leave the field empty and press Enter. The key is saved in the default directory or in the custom location specified during creation.
  4. The public key is saved in the .pub file. Add this public key to the Customer Portal as described in Add a public key.

Add a public SSH key to the customer portal

If the SSH key was not generated via the Gcore Customer Portal, add the public key there:
  1. In the Gcore Customer Portal, go to Cloud > SSH Keys.
  2. Click Add SSH Key.
SSH Keys page with the Add SSH Key button
  1. In the SSH key content field, paste the public key.
  2. Enter a key name and click Add SSH Key.
Add new SSH Key dialog with SSH key content and name fields
  1. The key appears in the SSH keys list and can be selected as an authentication method when creating a new instance.
After a public key is added, it is automatically shared with all users in the same project. To change the key’s visibility, see Stop sharing.

Manage SSH keys in the customer portal

Public SSH keys can be deleted from the Gcore Customer Portal, shared with other users in the same project, or restricted to a single user.

Delete SSH keys

Only the user who created an SSH key or added the public key to the Gcore Customer Portal can delete that key. To delete the key:
  1. In the Gcore Customer Portal, go to Cloud > SSH Keys.
  2. Find the SSH key to delete and click the three-dot icon.
  3. Click Delete.
  4. In the confirmation dialog, click Delete SSH key.

Stop sharing SSH keys

After an SSH key is added or generated in the Customer Portal, the public key is automatically shared with all users in the same project. To stop sharing the key and restrict visibility to the current user:
  1. In the Gcore Customer Portal, go to Cloud > SSH Keys.
SSH Keys list in the Gcore Customer Portal
  1. Find the SSH key to stop sharing and click the three-dot icon.
  2. Click Stop sharing.
  3. In the confirmation dialog, click Stop sharing.
Sharing can be restored by following the same steps and clicking Share from the three-dot icon.