Ubuntu: How to connect to another computer through the Internet using ssh?


I have Ubuntu 13.10 on my laptop which I would like to use to connect to my Ubuntu 12.04 desktop. I installed the open ssh server on the desktop machine using:

sudo apt-get install openssh-server  

I checked that the server is running:

sudo service ssh start  

and I get:

start: Job is already running: ssh  

Next I checked if there is a firewall using:

sudo ufw status  

and I get:

Status: inactive  

Next I found out the desktop's IP address by executing:

ip addr | grep inet  

and I get:

inet scope host lo  inet6 ::1/128 scope host   inet brd scope global eth0  inet6 fe80::21a:a0ff:fe10:e8da/64 scope link   

So I suppose that is my IP address.

Then on my laptop I verify that is pingable and then I do:

ssh -v martin@  

and I get:

OpenSSH_6.2p2 Ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 11 Feb 2013  debug1: Reading configuration data /etc/ssh/ssh_config  debug1: /etc/ssh/ssh_config line 19: Applying options for *  debug1: Connecting to [] port 22.  

And nothing else seems to be happening. Please, how can I troubleshoot this problem? What am I doing wrong?


I can safely ping the server machine:

martin@martin-Studio-1537:~$ ping -c3  PING ( 56(84) bytes of data.  64 bytes from icmp_seq=1 ttl=61 time=2.82 ms  64 bytes from icmp_seq=2 ttl=61 time=4.05 ms  64 bytes from icmp_seq=3 ttl=61 time=4.08 ms    --- ping statistics ---  3 packets transmitted, 3 received, 0% packet loss, time 2002ms  rtt min/avg/max/mdev = 2.823/3.653/4.082/0.587 ms  


I tried to diagnose the connection using nmap as suggested:

martin@martin-Studio-1537:~$ nmap    Starting Nmap 6.40 ( http://nmap.org ) at 2014-01-31 18:39 CET  Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn  Nmap done: 1 IP address (0 hosts up) scanned in 3.06 seconds  

and then:

martin@martin-Studio-1537:~$ nmap -Pn    Starting Nmap 6.40 ( http://nmap.org ) at 2014-01-31 18:40 CET  Nmap scan report for 193-51-236-62.lille.inria.fr (  Host is up (0.0056s latency).  Not shown: 998 filtered ports  PORT     STATE SERVICE  3128/tcp open  squid-http  8080/tcp open  http-proxy    Nmap done: 1 IP address (1 host up) scanned in 8.18 seconds  


Start by checking to see that you can ssh into the desktop from the desktop.


If that works, I would check to see if the outside IP and internal IP are different.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »