Posted by faizel isaacs on January 11th, 2009 filed in
SSH Support
- download OpenSSH from http://sshwindows.sourceforge.net
- Unzip it, and run the resulting installer
- Install the program to the directory of your choice (I will use c:OpenSSH). You will be best served by putting OpenSSH into a directory that does not contain any spaces.
- Take the defaults for the remaining setup screens
- After OpenSSH is installed, open a command prompt and cd to the OpenSSHBin directory
- Run mkgroup -l >> ..etcgroup
- Run mkgroup -d >> ..etcgroup
- Run mkpasswd -l [-u ] >> ..etcpasswd
- Run mkpasswd -d [-u ] >> ..etcpasswd
- Run “net start opensshd“
- On a seperate system equipped with an SSH client (such as PuTTY), ensure you can connect to the new server using a username and password that is valid for the server
- Once you have verified the OpenSSH service is working correctly, go ahead and “net stop opensshd“ to stop it
- From the command window on the server, cdopensshetc
- Copy sshd_config to sshd_config.bak just in case something goes horribly wrong and you want to return to the default configuration and start over
- cd ..bin
- Run “ssh-keygen -t rsa“ (we will be generating an SSH2 RSA key, which is the currently recommended key)
- When asked for where we want the key files to be placed, DO NOT TAKE THE SUGGESTED LOCATION. Instead enter “/etc/id_rsa“ (the use of “/“ is important here, you cannot use ““)
- Enter a passphrase (you can leave the passphrase blank, but a passphrase will prevent the key from being used if someone happens to acquire it)
- Enter the passphrase a second time
- Observe two files being generated, “id_rsa“ (your private key, which your client machines will need) and “id_rsa.pub“ (your public key, which stays on your server)
- Run “cd ..etc“
- Perform a “dir“ and ensure the two files are there. If they aren’t go find them and put them there.
- Run “copy id_rsa.pub authorized_keys“ The goal is to make a copy of the public key file, named “authorized_keys“
- Grab the other file (id_rsa) and copy it by whatever means necessary (network, floppy, usb flash disk, pigeon, whatever it takes) to the machine you will be using as the client. (This file is your private key, and should be treated as highly confidential. If you used a well-thought-out passphrase when generating the key, then it is nigh unusable if someone comes across it. Otherwise, if someone gets a hold of this file, they can IMPERSONATE YOU when connecting to your SSH server. Pass phrase or not, this file should be treated as sensitive, and erased from whatever media you used to move it to your client.)
- Run “net start opensshd“ and check in the Services applet that is has started and is running.
- On the client, assuming you have SSH client tools installed, you can run “ssh -l “ from the directory where the id_rsa file was copied, and it should prompt you for the pass phrase, if you entered on during key generation. Once the pass phrase is entered, it should connect to the SSH server and give you a command prompt.