Sunday, February 15, 2009

How to install OpenSSH Server in HARDY with Port Forwarding in your Linksys Router

Before we start I have to tell you,really bored to write this, but my dear Dadu keeps telling me that i should keep updating the blog.So here it is.


To Enable SSH all we need to do is install OpenSSH. To install OpenSSH follow the steps mentioned. Open the Terminal either by going in Application->Accessories->Terminal or by doing ALT+F2 and typing "gnome-terminal" (without the quotes) in the RUN enter. Once the terminal pops up, copy paste or type the following command in the Terminal.

sudo apt-get update

after the update type this

sudo apt-get install openssh-server

Once Openssh is installed, we need to configure it.(This can be optional, but I would suggest to do it so as to increase the security of your system)
For this we need to open up the sshd_config file.
Type the following command in Terminal(or copy paste) :)


sudo gedit /etc/ssh/sshd_config

(You can use any editor of your choice vi emacs or whatever, I have used gedit)
once the file opens up search for the following
line.

PermitRootLogin

set it to NO, which should look like this.

PermitRootLogin no



Also If you want you can change the default port from 22 to something you like, as this would boost up your security for default ssh atta
cks on port 22. To do this search for the line called Port. Change the value there from default 22 to something you like.
After this is done, save the file and close it.Now we need to restart the ssh service.To do that we need to type in the following command in the Terminal.


sudo /etc/init.d/ssh restart


Thats it you have successfully installed OpenSSH on your machine.


Now if you are behind a router or a firewall you will need to enable the port forwarding.
I have a linksys wifi router, hence I'll be taking that as as an example. If you have any other you can visit portforward.com & see how to enable Port Forwarding in your router. Type in your routers IP address in the browser to open up the browser console page.


which in turn will open up the below.



One the above page opens up, click on Advanced settings which will open up the user id password setup.Type in your user id & password.



Once on the linksys console page do as shown below.





In the Application feild type anything you like(thats just for your reference). Type the port number you have kept for OpenSSH in the Start & End field, type the IP of your computer & check mark Enable. Once this is done, click on Save Settings to save the settings. Thats it You have now configured your linksys router for Port Forwarding for OpenSSH.


No comments: