Setting up SSH
The following short tutorial walks you through the steps you need to take in order to
get SSH working
between your windows workstation and your linux server.
Setting up an SSH
connection between the Win workstation and the linux server
- Run puttygen to generate your private /public key pair. Once loaded, ensure that SSH2 DSA is selected
in the parameters section and click on the generate button. Follow the instructions on the screen, you will
need to move your mouse around the screen to create the key.
- Once the key has been generated fill the key comment field with a comment that will uniquely identify
this key in your authorized keys file. The default key comment dsa-key-20041101 is pretty much useless when
you need to clean up your authorized keys file. Put in something like myserver@grahamlange.home. The key
comment doesnt affect how the key is generated.
- Add a passphrase for this key. You dont have to do this, but its a pretty good idea to add one.
- Click on the button labeled Save private key. Save it somewhere you can access it with putty.
ie: c:/my documents/ssh
- Highlight and copy the text from the comment field at the top of the window. This is your public
key and you will need to copy it into your authorized_keys file on the linux server.
- If you dont already have access to the linux server you will have to copy the public key to
a floppy and sneaker net it over to the server. By default keyboard interactive authentication
is turned on so you should be able to shell into linux using your password.
Setting up PuTTY configuration
- Run up PuTTY.
The following is just a guideline for setting up the putty configuration.
You might want to set it up differently depending on your personal preference.
- Hostname = myserver, protocol = SSH
- Under the connection section set the auto-login username to your username ie: graham.
- Click on the SSH section
and set the protocol to 2 only. You generated an SSH2 key in the instructions above.
- Click on the Auth subsection and browse for the PuTTY
private key you generated earlier.
- Go back to the session section and save this configuration for later!
Adding your public key to fedora
- After logging in to the server check to see if this user has an .ssh folder. If not,
you will need to create one along with an authorized_keys file.
[graham@fedora graham]$ mkdir .ssh
[graham@fedora graham]$ cd .ssh
[graham@fedora .ssh]$ vi authorized_keys2
- And paste your public key into the authorized_keys2 file.
- Test your login to the linux server using
PuTTY. This time it should ask you for your passphrase.
- You can turn off the keyboard-interactive authorization method in the file /etc/ssh/ssh_config.
Its a good idea to do this, as your passphrase is generally a longer more complicated password. And the
fact that your password gets echoed to the log.
Good luck!