I will describe here how to install and setup SSH client PuTTY for Windows. Also there will be step-by-step manual of the key generation process and client setting up to create secure connection to the SSH server. То же самое по-русски.
PuTTY is SSH and telnet client. (But in the moment we are interesting now only in ssh). It is freely distributed by MIT license. So You can get it here. Also the SHA-256 sum You can get here. One have to unzip just downloaded file in a specially created folder, for example, putty. And after that in this folder You can see several executables (as on the fig. 3, but without keys).
Key generation for SSH client PuTTY
The first step is keys creation for SSH client PuTTY in order to establish secure connection to SSH server.
1. Lunch the program puttygen (fig. 1.). Choose SSH2+RSA (1) and leave as is 2048 bits (but, I think, in general will be enough 1024 bits). Because DSA keys for SSH is deprecated now. Then, click on the button “Generate”.
Further, the key generation process will take some time depending on your efforts to speed it up. If you want to finish key generation process quickly, then You should quickly move your mouse around the table. When You move, You can see, that the green line became longer, when You do not move your mouse, the line looks the same size (Actually, it became longer, but very slowly). Finally, sooner or later the process will be complete (see fig. 2.).
2. Then we have to prepare to use just generated keys. One have to save all text in the window “Public key for pasting into OpenSSH authorized_keys file” (1) from the beginning to the end. One need to scroll the text to copy everything, we needed. The text should to begin with “ssh-rsa” and end with “rsa-key-20170206”. Probably, the number “20170206” will be different. Because this is today’s date. Then we have to paste copied text to Notepad’s new window. We can use only Notepad, since it does not modify the inserted text and does not apply any formatting. Finally, we have to save the file with name “authorized_keys2”.
3. Create a good password for the private key. What is a good password and how to create it, I wrote in the post “What is ssh/sftp and what is it for?“. You have to type it twice in the fields “Key passphrase” and “Confirm passphrase” (2).
4. Click to the button “Save public key” (3) to save public key file to the hard disk.
5. And the last, You have to click to the button “Save private key” (4) to save your private key file on disk in an encrypted form. To use it, one have to know just created password.
Fig. 3 shows the keys stored on disk. id_rsa.ppk is the private key and id_rsa_pub is the open (public) key. Therefore key creation process has been successfully completed. Terminate the program.
Then should be the second step. You have to place or add authorised_keys2 to the server. How to do this I wrote in detail in the post “Setup ssh server“.
SSH client PuTTY setup
The third step. We have to setup SSH client PuTTY. Lunch program PUTTY. You have to consequently open marked by red line on figs 4,5,6,7 and 8 tabs and type marked parameters.
First of all, on the main tab (which opened at the program start), select SSH and enter the IP address or FQDN of the server (Fig. 4). Then You should go to the «Data» tab and enter the user name (Fig. 5).
Then click the plus sign on the SSH tab and go to the opened tab «Auth». Using Windows Explorer, select the just generated and stored on the disc private key file (Fig. 6).
Now You should go to the tab SSH and select protocol “SSH2 only” (Fig.7.). After this setup the client for Windows PuTTY SSH completed.
Go back to the main tab «Session» (Fig. 8.) And save settings. Enter a friendly name of the session (1), then click the «Save» button (2).
Finally, You can try what You just have done. Press the button «Open» (3). If there was no mistake, you should be prompted for a password, which is required for use your private key, as one can see in Fig. 9.
After you type private key password, as a result, you should successfully establish secure ssh connection to the server (fig. 10.)
If you plan to use SSH client PuTTY for Windows to manage multiple servers, it is necessary to create and save the configuration of each server similarly.
When I work with my servers, usually I establish many SSH connections to one server. To do this, one must launch PuTTY as many times as one needs connections.
This post I have described how to install and configure SSH client PuTTY for Windows. Good luck!
No comments yet.