Managing Server SSH Keys
CloudRay provides a secure way to store and manage your SSH keys for authenticating with remote servers. SSH keys are cryptographic key pairs (a public key and a private key) that offer a more secure alternative to password-based authentication. This documentation explains how to create, add, and use SSH keys in CloudRay.
Understanding SSH Keys and Server Keys in CloudRay
- SSH Keys: These are the actual cryptographic key pairs (public and private) used for secure authentication
- Server Key (in CloudRay): This is a resource within CloudRay where you store the private portion of your SSH key along with a name for easy reference
Generating an SSH Key Pair
Before adding your server to CloudRay, you need an SSH key pair for secure authentication. An SSH key pair consists of a private key, which is added to the server, and a public key, which remains securely stored on your local machine.
NOTE
If you already have an SSH key pair, you can use it as long as it matches the one installed on your server.
Otherwise, follow the steps below to generate a new SSH key:
- Open a Terminal on your local machine (or use an SSH client like PuTTY if you’re on Windows)
- Use the following command to generate an SSH key pair:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
-t rsa
: specifies the RSA algorithm-b 4096
: generates a 4096-bit key for enhanced security-C "[email protected]"
: Adds an optional comment (For example, [email protected]) to help identify the key

- When prompted, enter a filename to save the key (you can press Enter to use the default
~/.ssh/id_rsa
) - Optionally, set a passphrase for added security. Again, you can Press Enter to skip if you don’t want one
After completing these steps, you’ll have two files:
- id_rsa (private key) – This key will be added to your server and to CloudRay
- id_rsa.pub (public key) – Keep this file secure and never share it
To confirm that the SSH key was created successfully, you can run this command:
ls -l ~/.ssh/id_rsa*

This should display both the private and public key files.
Now that you have your SSH key pair, the next step is to add it to CloudRay for seamless authentication.
Adding SSH Key in CloudRay
After generating your SSH key pair, the next step is to add it to CloudRay. Unlike most platforms that require the public key, CloudRay uses the private key (id_rsa
) for authentication.
First, navigating to the .ssh
directory and displaying your private key content:
cd .ssh
cat id_rsa

Copy the key displayed in the terminal.
Next, to add the copied SSH key to CloudRay, follow these steps:
- Navigate to “Server Keys”: Click on the “Server Keys” tab in CloudRay’s main navigation

- Click “Add Server Key”: Start the process of adding your SSH key. Give the key a descriptive name (For example auth_key), and add the private key.

- Save Server Key: Click “Create Server Key” to store your SSH key securely within CloudRay

Now that your SSH key is stored in CloudRay, you can use it to authenticate with your servers easily.
Next, let’s see how to add your server to CloudRay.
Using Server Keys with Your Servers
If you don’t already have a cloud server, you can get one from popular providers like AWS, DigitalOcean, and Google Cloud.
Once you have a server ready, follow these steps to add it to CloudRay:
-
Navigate to Servers in the dashboard
-
Fill in the Server Details:
- Provide a name for the server
- Enter the server’s IP address or hostname
- Under Access Method, select “Use SSH Key” (Choose “Use SSH Password” instead, if you prefer password-based authentication)
- Choose the SSH key you added earlier

- Click “Create Server” to finalise the process

Your server is now added to CloudRay and ready for secure SSH-based authentication!
For more details on server management in CloudRay, refer to the Server documentation.
Important Notes
- Security: CloudRay encrypts all stored SSH keys to ensure their confidentiality.
- Key Management: Keep your original private keys secure and avoid sharing them. If a key is compromised, remove it from CloudRay immediately and generate a new one.
- Troubleshooting: If you have trouble connecting using a server key, double-check the following:
- The public key is correctly installed on your server.
- The private key you entered in CloudRay matches the public key on the server.
- Your server’s firewall allows SSH connections from CloudRay.