Wednesday, August 29, 2012

What is SSH and how do I do it? [beginners]

One of the biggest obstacles people must overcome in order to start using more advanced computer techniques, is their reliance on the graphic user interface or GUI.

Every time a friend asks me how to do [some complicated computer task] and I begin to explain the terminal commands they need to use, they cut me off and assert, "There must be a program that I can use!"

It is not always the case that a graphic program is available. Many developers are good at programming scripts and making a code do what they want, but have no interest in spending ten times as long building a GUI for that small piece of code.





The command line interface (CLI) is what comes to mind when you hear words like DOS or terminal. The classic monochrome black screen with text.

The commands that you learned way back when DOS was king will not work on the unix command line. They are just different commands, but the idea is exactly the same.

Almost every device that runs linux or unix has SSH setup by default.

SSH allows you to control the CLI of a target machine. For example, I am on computer A and want to run a command on computer B. I use SSH to login to computer B from computer A. Then I run the command.

Many tutorials on iPhone tweaking ask you to SSH into your phone. This is again just a way of using your computer to run command line commands on your phone. VERY VERY SIMPLE!

The hardest thing to overcome is just realizing that you can do complicated tasks by typing commands.

You DO NOT need to know the ins and outs of unix commands to start using SSH.

Lets jump right in and show you how to start an SSH connection from Windows.

To SSH from windows you will need to download a small program called putty.

Putty SSH client
Click the link above and install the client.

Run the program and input your target machine's ip address. This can be found by going to opening a terminal on the target machine and typing ifconfig in linux/OSX, ipconfig in windows, or going to settings>wi-fi>your wifi network>ip address on iOS.

Plug the target ip address into putty and press enter or connect.

You will be asked if you want to accept the device security certificate. Press yes.

Then you will be greeted by a command line asking for a username and password.


Logging in here is the same as logging in as a user normally. Just put in the username and password that you would use for that machine.

You now have access to the target machine's command line.

From here you can input commands that are listed in various guides across the web!

SSH from linux or OSX

Starting an SSH connection in a unix based OS is even easier than in windows. Here is a good example again of when and why a GUI is not necessary!

In windows we had to download and install a program called Putty, in linux/OSX we just open a terminal.

The terminal gives you the command line interface for your computer in a nice little window.

In this terminal type

ssh user@ip.address.here

Just replace user with the username you want to use, and the ip address goes after the @.
You will be asked if you want to accept the certificate, choose yes.
Then enter the password when prompted.

You now have access to the command line of the target machine!


Using the entire GUI in windows makes no sense. This is why many programs have no GUI. Why should a developer spend months building a GUI, when you could just type in a three letter command?

You now have the basic knowledge needed for using SSH!

No comments:

Post a Comment

Blogger won't auto-notify the author of your comment, but he does reads through them every few days to post replies.