查看文章 |
Using Putty on Windows to login Linux securely via OpenSSH
This is a guide about using Putty on Windows with OpenSSH on Linux. You would learn about how to: I would assume that you have OpenSSH installed. As per 31-May-2006, the latest version of OpenSSH was 4.3p1. Your Linux distribution may likely use an older version, however. Configuring OpenSSH to accept public-key authenticationTo enable your OpenSSH to accept version 2 public key, you would need to modify /etc/ssh/sshd_config. You could use vi editor (or whatever editor you are familiar with) to uncomment/add/modify the following lines to /etc/ssh/sshd_config: # the default SSH port is 22, you could alter it if necessary After you have made changes to /etc/ssh/sshd_config, you would need to restart the OpenSSH daemon by executing `/etc/init.d/ssh restart` (on Ubuntu). Generating OpenSSH private and public key pairTo use public key authentication, the first step is to generate a pair of private and public keys on the Linux side. I would assume that you login as a user called "toylet". 1. Login Linux as user "toylet". You could do it at the Linux console Converting the OpenSSH private key to Putty formatNext, we head to the Windows side. In step 4, you created two key files (id_rsa and id_rsa.pub). Putty cannot directly open OpenSSH keys. We need to convert id_rsa to id_rsa.ppk using a program called puttygen.exe. 6. At the Windows side, download puttygen.exe from Putty website.
8. Click File->Load Private Key, load the file "id_rsa" from Step 5.
9. Now the key has been loaded as in the figure above. Logging in Openssh using id_rsa.ppkDownload putty.exe from Putty website. It's time to really login OpenSSH using putty.exe on Windows side. The steps here would be a little bit more complicated. 10. Invoke putty.exe
10.1.1. Enter ip address of your server (e.g., 192.168.1.2)
10.2.1. In "Preferred SSH protocol version", select "2 only"
10.2.2.1. Hit the Browse button, select the file "id_rsa.ppk" from Step 9.
10.3.1. Enter a name (e.g. "toylet.session") in the textbox directly
10.4. Double-click "toylet.session". Now you would be presented Epilogue
|
