SSH Guide

**Note: This Guide was written for use by my Computer Science class

on Linux (and Mac OS X where noted). I haven’t used SSH on Windows; but hopefully someone can make sure this guide works also on Windows by noting differences). SSH comes with nearly all Linux distros and all Mac OS X releases.
**

OS Specific Colours: Linux - Mac OS X - Windows
**
**
**Download SSH For Windows
**

***Windows: ****You need to follow README located in Start > All Programs > OpenSSH > README to set up password directories and files. After that is done; just do Start > Run; type cmd and hit enter to get Windows command line. All commands beginning with SSH should run unmodified. ****


By default it allows access to your username and password; which is okay but not totally secure! If you are logging on from a machine which has the same username as one you are trying to access you can drop ‘myusername@’ bit. mylaptop represents the IP address of the machine you are trying to contact!

$ ssh myusername@mylaptop

To forward X server (use the flag -Y on Mac OS X) :
$ ssh -X myusername@mylaptop

To use a different port (where port is WXYZ) also: (use the flag -Y on Mac OS X):
$ ssh -X myusername@mylaptop -p WXYZ

How to get it more secure:* *

*Generate your own key (this will ask for a password; can be left

blank but not recommended):*

$ ssh-keygen

Copy your key to machine you want to login to:
$ scp ~/.ssh/id_dsa.pub mylaptop:~/.ssh/authorized_
keys2
(This command uses SCP (Secure Copy) to copy your key into a list of keys allowed on remote machine. You also have an authorized_keys2 on your computer)

Edit Configuration File:

Finally edit configuration to make it more secure (nano is a lightweight text editor - this command will be very different on Windows; since it won’t have sudo command, nano editor or the SSH configuration file in the same place; I currently have no clue what it would be on Windows):
$ sudo nano /etc/sshd_config

Stop/Start OS X To stop SSH Server, enter: $ sudo /sbin/service ssh stop To Start SSH server, enter: $ sudo /sbin/service ssh start **
That is it!**
Most of the options you can skip based on preference. I recommend not allowing password only login and setting up keys. It is much harder to break; and there is no ‘known’ way to break it….