RealHOST...

Virtual Data Center How to generate keys for ssh access?


When creating and using a virtual data center, it is recommended to include the SSH public key in the user profile setting. This key will be copied to all newly created virtual machines, that will allow you to connect to them without using a username and password.

SSH keys are a pair of private and public keys. The private key must be stored in private access by the client, the public one should be stored to the server and placed in a file authorized_keys.

Creating SSH keys on Linux

The ssh package (openssh) must be installed on your Linux system. 
At the command prompt, run the key generation command:

ssh-keygen



 

Enter the path of the file where the keys will be placed. The default directory is indicated in parentheses, in the example / home_directory/.ssh/id_rsa. If you want to leave the default location, press Enter.

Password (passphrase) is used to restrict access to the private key. Password will complicate the use of the key by third parties in case of loss. If you do not want to use a passphrase, press Enter without filling in a line.

Having successfully generated a key pair, you will see a notification:



The public key is stored in the file /home_directory/.ssh/id_rsa.pub, the private one is stored in /home_directory/.ssh/id_rsa.

Creating SSH keys on Windows with PuTTYgen

Key generation in Windows can be performed using the PuTTYgen utility from the PuTTY software package.

Run the application PuTTYgen.



Select the SSH2-RSA key type and click Generate.



In the process of generating keys, randomly drag the mouse several times on the application screen to create random values used for keys.


After the keys are created, the public key is displayed on the screen, the private key is stored in the application memory. To save these keys, click Save public key and Save private key. Specify the location of the key files. 



When saving the private key, if the Key passphrase field is not filled in, the query “Are you sure you want to save the key without a passphrase?" will appear

We use a cookie to best reflect the site.
By using this site, you agree to our Privacy Policy