4/01/2011

SSH

Secure Shell or SSH is a network protocol that allows data to be exchanged using a  secure channel between two networked devices.

 
Port no. 22

Why use SSH?
Suppose that some contents are blocked in your college or work place. For example, in my college, torrents are blocked. You can SSH into your system from anywhere and access internet like you were at home. The advantage of using SSH is that the information transmitted will be encrypted.

How do you use SSH?
First thing you need is a SSH server that you need to set up at home. Then you can access this server from anywhere on the internet securely using a SSH client. A common example for a windows SSH client is Putty.

Example:
There 2 ways of authentication that can be done:
1. Using password
2. Using public key cryptography and/or passwords

SSH Server:    Backtrack
SSH Client :    Putty (Windows)

Port Forwarding 
The first thing to be done is go into the router's page, and do port forwarding on any port. When we do port forwarding, all the data coming to that port on the router will be forwarded to our system. You don't have to worry about security because we are using SSH.



Method 1:
Open terminal and type sshd-generate. This will create the rsa and dsa public, private keys.
Set up the SSH Server on Backtrack- Go to Start-Services-SSH-SSHD start.
Now you can check if the SSH server is running using nmap -p22 localhost , where p22 means port no. 22.
Leave your system connected to the internet with the SSH server running. If pot 22 is open, SSH is running.

Go to any outside network, install putty.
Under sessions, enter the server's , Backtrack's IP and port no.22. You can save this using Saved sessions .
Look for SSH on the left side. Expand it and under Tunnels, enter any port no.(source), select Dynamic. ADD. Now select D4656 on the box. Open.

Now click Open to open the SSH connection
Since this is the first time you are connecting to your server, you will get a warning like this:
Click yes.Enter username and password. BINGO!!! You have created the tunnel.

But we are not yet done. Go to your firefox. Give proxy(Tools-Advanced-Network-Settings)
Use proxy as given below.  Remember to the same Port no. as we gave source port on Putty.
Just one more step: Type about:config on you firefox address bar.
Find network.proxy.socks_remote_dns. Change its value to True.
Restart Firefox.
Now you can surf web as if you were at home, no restrictions. Also the communication between you and your server is secure.

I will explain the second method i.e, authentication using public key cryptography in my next post.

No comments:

Post a Comment