Hui Wang

no Tech, no Info

Hope you find this simple and helpful.

how to setup an openssh home server in ubuntu

Posted on | September 15, 2009 | Views (71)

In this simple tutorial, I am showing you how to make the openssh server accessible via distance rather than just install several binary packages.

Anyway, we should firstly get the packages installed. Fire up a terminal and hit the following command:

sudo apt-get install ssh openssh-server openssh-client

Secondly, make sure the server is working correctly

sudo /etc/init.d/ssh restart

Thirdly, check whether the port 22 which openssh server is listening on is open. A package called Nmap is needed here. Run the following command:

sudo apt-get install nmap

If your computer is behind a router, please find the its public ip first, you can find it by connecting to your router’s web interface, typically by typing 192.168.1.1 in your preferred browser. If not get it directly by hitting ifconfig in your termernal.

Right now, with the public ip, run the following command:

sudo nmap -sS -O your_public_ip

Last, if port 22 is open, everything is done. Connect to your server with this command:

ssh your_user_name@your_public_id

If not, you must have at least another ONE open port from the result of nmap, and then configure your router to forward requests on this open port to the port 22. Typically in your router configuration table, you could find an column called NAT. The picture below is showing my configuration.
ssh_nat

Ok, get connected by using this command:

ssh your_user_name@your_public_ip -p the_open_port

Please feel free to let me know if it doesn’t work for you.

Comments

Leave a Reply






  • About

    Hui WANGHi everyone, I'm Hui, a student originally from China, now studying at TELECOM SudParis in France. Hui-Wang.info is being used as a place to record my various adventures with technology.

  • Find Me On

  • Search