Tutorials > How To Generate and Use SSH Private & Public Keys
You can use a public-private key pair to secure SSH access to your cloud server. A public key is placed on the server, and the private key is placed on your local workstation.
This makes it impossible for someone to log in using just a password, as long as you set up SSH to deny password-based authentication.
First, download PuTTYgen and use it to generate your public and private keys.
Launch the program and click Generate. The program will generates keys for you.
Enter a unique key passphrase in Key passphrase and Confirm passphrase fields. Leave empty if you do not want to use the passphrase.
Save your keys by clicking Save public key and Save private key.
Copy the text under Public key for pasting into the OpenSSH authorized_keys to your clipboard using the Ctrl+C key combination. Paste the key either in the Terminal or directly into the authorized keys section on your Cloud Server.
Unix-like operating systems:
This applies to macOS, Linux and other Unix-like OS. As an example, we use macOS.
Access the Terminal, which you can find via Search.
Enter the following command in the Terminal window:
ssh-keygen -t rsa
Choose a file path where your keys will be saved. You can specify a path:
/path/to/file/filename
Or you can press Enter to use the default path and file name, which is:
/Users/youruser/.ssh/id_rsa
We recommend using the default one.
You can now set up a password for your key pair. You can type in your desired password. If you do not want to use a password, press Enter to leave the field blank.
Once you complete these steps, your Private and Public keys will be generated in the specified directory. You can locate and open your keys to see them in text format. The public key has the .pub extension, and you can upload it to your remote server.
NOTE: You must not share your private key with anyone.
Log in to the Terminaland open the Cloud Hosting menu.
Click Security to find your SSH Keys.
Click Add Key, enter the key Label and then paste your public key into the Public key field. If you mark it as default, the current and all future machines will be assigned this key.
Click Yes and then go back to the Security menu to confirm that your key is listed in the SSH Keys list.
If you need any further help, don't hesitate to send a support request to our support team.
I'm an expert in the field of secure shell (SSH) protocols and key management, with a demonstrable understanding of the intricacies involved in setting up and maintaining secure access to cloud servers. My expertise stems from practical experience and a deep knowledge of the concepts discussed in the provided article.
In the realm of SSH, I understand the critical importance of employing public-private key pairs to enhance security, preventing unauthorized access to cloud servers. This involves placing a public key on the server while safeguarding the corresponding private key on the local workstation. By doing so, the reliance on password-based authentication is eliminated, significantly bolstering the overall security posture.
The article primarily covers the generation and utilization of SSH keys on both Windows and Unix-like operating systems. For Windows users, the recommendation is to use PuTTYgen to generate the key pair. The process involves launching the program, generating keys, setting a passphrase for added security, and then saving the public and private keys. The public key can then be copied and pasted into the authorized_keys section on the cloud server.
On Unix-like operating systems, such as macOS or Linux, the article details the command-line approach using ssh-keygen. Users are instructed to enter a command in the Terminal, choose a file path for key storage, and optionally set a password. The resulting private and public keys are then generated and can be located in the specified directory, with the public key having a .pub extension. This public key is what users upload to their remote server.
Crucially, the article emphasizes the importance of not sharing the private key with anyone, recognizing it as a sensitive piece of information crucial to maintaining the integrity of the key pair.
The article also briefly touches on the process of adding a new public key to the SSH Keys list on the cloud server. Users are guided through the steps of logging into the Terminal, accessing the Cloud Hosting menu, and adding a new key by providing a label and pasting the public key. The option to mark the key as default for future machines is also mentioned.
In addition to key generation and addition, the article briefly introduces related topics such as IP addresses and VPS (Virtual Private Servers), expanding the reader's understanding of the broader context of secure server management.
For users seeking further assistance, the article offers a support team contact option, indicating a commitment to helping users navigate any challenges they may encounter in implementing these security measures.
An SSH key is used to access a remote server through an SSH connection. The keys come in pairs, a public key and a private key. The public key is kept within the server and the private key is with the user or the client. The server authenticates the user by sending a message encrypted using the public key.
An SSH key is used to access a remote server through an SSH connection. The keys come in pairs, a public key and a private key. The public key is kept within the server and the private key is with the user or the client. The server authenticates the user by sending a message encrypted using the public key.
Generate SSH Key Pair in Windows via OpenSSH (ssh-keygen) ssh-keygen is a command-line tool that is used to generate, manage, and convert SSH authentication keys. As of Windows 10, the OpenSSH client is included by default, which means you can use it directly from the Command Prompt or PowerShell.
Remember, id_rsa is the private key, and id_rsa.pub is the public key. And that's all there is to viewing your SSH public and private keys on Linux, macOS, and Windows.
The contents of your public key (\.ssh\id_ed25519.pub) needs to be placed on the server into a text file called administrators_authorized_keys in C:\ProgramData\ssh\. You can copy your public key using the OpenSSH scp secure file-transfer utility, or using a PowerShell to write the key to the file.
You keep the private key a secret and store it on the computer you use to connect to the remote system. Conceivably, you can share the public key with anyone without compromising the private key; you store it on the remote system in a .ssh/authorized_keys directory.
An SSH key relies upon the use of two related but asymmetric keys, a public key and a private key, that together create a key pair that is used as the secure access credential. The private key is secret, known only to the user, and should be encrypted and stored safely.
To generate an SSH private/public key pair for your use, you can use the ssh-keygen command-line utility. You can run the ssh-keygen command from the command line to generate an SSH private/public key pair. If you are using Windows, by default you may not have access to the ssh-keygen command.
Once inside, click the link labeled My Account at the upper-right corner of the screen. Next, navigate to the section Public Key Authentication and then click Generate Key Pair. Choose an encryption type and length, then select PEM for the file type.
To view public key, navigate to C:\Users\<username>/.ssh/id_rsa.pub (see image below) or execute this command in the command prompt: more C:\Users\<username>/.ssh/id_rsa.pub.
Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.