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.
To 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 Port 22 # accept version 2 keys only Protocol 2 # NEVER allow root to login directly over the net PermitRootLogin no StrictModes yes MaxAuthTries 3 # enable public-key authentication RSAAuthentication no PubkeyAuthentication yes # securing your OpenSSH # do not use host-based authentication for security reason RhostsRSAAuthentication no HostbasedAuthentication no IgnoreUserKnownHosts yes PermitEmptyPassword no # do not allow telnet-type login for security reason ChallengeResponseAuthentication no PasswordAuthentication no X11Forwarding yes X11DisplayOffset 10
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).
To 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 or via telnet. 2. Execute `ssh-keygen -t rsa` to generate a version 2 public and private key pair into directory /home/user/.ssh. The passphrase is optional (but preferred). toylet@server:~$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/toylet/.ssh/id_rsa): /home/toylet/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/toylet/.ssh/id_rsa. Your public key has been saved in /home/toylet/.ssh/id_rsa.pub. The key fingerprint is: ec:f4:3f:b5:fe:2f:de:22:6c:42:8c:38:ad:6c:5e:96 toylet@server 3. Execute `cd /home/toylet/.ssh` 4. You should see 2 files: id_rsa and id_rsa.pub. Now execute the following command: cp id_rsa.pub authorized_keys 5. Copy /home/toylet/.ssh/id_rsa from Linux to Windows.
Next, 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. 7. Execute puttygen.exe
Download 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. Click "Session" in the sidebar.