Contents
Should you use different SSH keys for different servers?
As far as security is concerned, you don’t compromise your key in any way by using it to log in on a machine (as you would by using a password), so having separate keys for separate destinations doesn’t make you any more safe from an authentication/security perspective.
What do I do with a private SSH key?
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.
pub indicates that it is a public key which is fine to share with anyone managing a remote machine you want to access via ssh . The corresponding private key which should not be shared is id_rsa .
How do you share a private key?
The proper way to do this in an unsecured channel is to use a public key infrastructure to send a private key. 1) The receiving party generates a public/private key pair. 2) The sending party will then use the public key of the receiving party to encrypt The Private Key and send it.
Windows (PuTTY SSH Client)
- On your Windows workstation, go to Start > All Programs > PuTTY > PuTTYgen. The PuTTY Key Generator displays.
- Click the Generate button and follow the instructions.
- Click Save Private Key to save the private key to a file.
- Close the PuTTY Key Generator.
Do you need a public or private key for SSH?
You need your SSH public key and you will need your ssh private key. Keys can be generated with ssh-keygen. The private key must be kept on Server 1 and the public key must be stored on Server 2. This is completly described in the manpage of openssh, so I will quote a lot of it.
How to properly manage SSH keys for server access?
Usually, this is done using public-private key encryption where each developer generates their own public-private key pair. The public keys of each developer are added to the authorized_keys file on each server they should have access to.
Where is the private key stored in OpenSSH?
The private key must be kept on Server 1 and the public key must be stored on Server 2. This is completly described in the manpage of openssh, so I will quote a lot of it. You should read the section ‘Authentication’.
How to generate a key pair for SSH?
The other method is to password-protect your private key so that you are prompted for the password when authenticating (think two-factor authentication using both the private key and the password). To generate an SSH key pair, use the following command: