Generate Ssh Key Linux Putty
You can generate an SSH key on Windows using the PuTTY SSH client. You can download PuTTY for free from this URL. To generate a key with PuTTY, you should: Download and start the puttygen.exe generator. In the 'Parameters' section choose SSH2 DSA and press Generate. Move your mouse randomly in the small screen in order to generate the key pairs. While not required, the SSH private key can be encrypted with a passphrase for added security. The PuTTY SSH client for Microsoft Windows does not share the same key format as the OpenSSH client. Therefore, it is necessary to create a new SSH public and private key using the PuTTYgen tool or convert an existing OpenSSH private key.
- 5 Generate A Private/Public Key Pair. We can use PuTTYgen to create a private/public key pair. Start it by double-clicking its executable file. Make sure you select SSH-2 RSA under Type of key to generate and specify 1024 as the Number of bits in a generated key. Then click on Generate.
- My Git setup runs fine on Linux, but when I try to set things up under Windows (using Git for Windows and TortoiseGit), I don't know where to put my private SSH key (or, better still, how to tell ssh.
- Save the text file in the same folder where you saved the private key, using the.pub extension to indicate that the file contains a public key. If you or others are going to use an SSH client that requires the OpenSSH format for private keys (such as the ssh utility on Linux), export the private key: On the Conversions menu, choose Export.
- If you don't already have an SSH key, you must generate a new SSH key.If you're unsure whether you already have an SSH key, check for existing keys. If you don't want to reenter your passphrase every time you use your SSH key, you can add your key to the SSH agent, which manages your SSH keys and remembers your passphrase.
- PuTTYgen is a key generator tool for creating pairs of public and private SSH keys. It is one of the components of the open-source networking client PuTTY. Although originally written for Microsoft Windows operating system, it is now officially available for multiple operating systems including macOS, Linux.
The PuTTYgen program is part of PuTTY, an open source networking client for the Windows platform.
- Download and install PuTTY or PuTTYgen.
To download PuTTY or PuTTYgen, go to http://www.putty.org/ and click the You can download PuTTY here link.
- Run the PuTTYgen program.
- Set the Type of key to generate option to SSH-2 RSA.
- In the Number of bits in a generated key box, enter 2048.
- Click Generate to generate a public/private key pair.
As the key is being generated, move the mouse around the blank area as directed.
- (Optional) Enter a passphrase for the private key in the Key passphrase box and reenter it in the Confirm passphrase box.
Note:
While a passphrase is not required, you should specify one as a security measure to protect the private key from unauthorized use. When you specify a passphrase, a user must enter the passphrase every time the private key is used.
- Click Save private key to save the private key to a file. To adhere to file-naming conventions, you should give the private key file an extension of
.ppk
(PuTTY private key).Note:
The.ppk
file extension indicates that the private key is in PuTTY's proprietary format. You must use a key of this format when using PuTTY as your SSH client. It cannot be used with other SSH client tools. Refer to the PuTTY documentation to convert a private key in this format to a different format. - Select all of the characters in the Public key for pasting into OpenSSH authorized_keys file box.
Make sure you select all the characters, not just the ones you can see in the narrow window. If a scroll bar is next to the characters, you aren't seeing all the characters.
- Right-click somewhere in the selected text and select Copy from the menu.
- Open a text editor and paste the characters, just as you copied them. Start at the first character in the text editor, and do not insert any line breaks.
- Save the text file in the same folder where you saved the private key, using the
.pub
extension to indicate that the file contains a public key. - If you or others are going to use an SSH client that requires the OpenSSH format for private keys (such as the
ssh
utility on Linux), export the private key:- On the Conversions menu, choose Export OpenSSH key.
- Save the private key in OpenSSH format in the same folder where you saved the private key in
.ppk
format, using an extension such as.openssh
to indicate the file's content.
PuTTY is a free and open-source SSH and telnet client. It is primarily developed by Simon Tatham for Microsoft Windows but now it supports a wide variety of other operating systems. Public key authentication is a feature of PuTTY, in which, we can configure SSH Keys to allow password less logins to Linux machines from our PuTTY terminals.
In this article, we are configuring SSH Keys using PuTTYgen and then configure a CentOS 7 machine for password less logins by PuTTY client.
This Article Provides:
Environment Specification:
One Microsoft Windows based client and a CentOS 7 based server.
Generate SSH Keys using PuTTYgen:
PuTTYgen is included with PuTTY SSH client. Both are free and open source and distributed under MIT License. Therefore, it is available for free download at PuTTY official website.
We have already installed PuTTY SSH client on our MS Windows client.
Search and run PuTTYgen application.
Click on Generate button to generate a SSH Public/Private keys pair.
Meanwhile, we are required to scroll mouse in the area under the progress bar for randomization and generation of SSH Keys.
PuTTYgen has generated a SSH Public/Private keys pair.
Click on Save private key button to save the SSH Private Key locally.
Since, we are not defining any passphrase, therefore, PuTTYgen is displaying the above warning.
Ignore it and click on Yes.
We have saved our SSH Private Key in a local directory. You can also save your SSH Public Key in the same way, if you plan to use this same SSH Keys pair for more than one Linux machines.
Select the generated SSH Public Key and copy it to clipboard.
Configure SSH Keys for Password Less Logins to CentOS 7:
Connect to our CentOS 7 machine using PuTTY and insert SSH Public Key in ~/.ssh/authorized_keys file.
Add Ssh Key To Putty
Now, open PuTTY and add a session for that CentOS 7 server.
Besides other settings, we are required to include our SSH Private Key as follows:
Save first and then open this session.
Putty Generate Ssh Key
Our CentOS 7 server won’t prompt for a password this time.
Putty Ssh With Key
We have successfully configured SSH Keys using PuTTYgen for password less logins to Linux machines.