[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: newbie question on port forwarding(and ssh, netcat)



On Wed 10 Oct 2012 at 08:35:13 -0700, houkensjtu wrote:

> I am a newbie both of debian and networking...  Recently I am trying
> to connect my home laptop(I have a router in my home) from office. I
> read several articles on port forwarding. And I succeeded in opening
> an 22 port on my router, also I started ssh server on my home laptop.
> 
> (suppose my username at home is USER, and my laptop is called DEBIAN)
> 
> I did several experiment and I got confusing in some of its result.
> 
> 1. ssh USER@DEBIAN
> 
> works well!!

We assume this means you were able to log in with your password, so it
very much looks like you have set up port forwarding to the home machine
correctly. Would you please say how your office machine resolves the IP
number for DEBIAN.
> 
> 2. nc -vz my_home_external_ip 22
> [my_home_external_ip] 22 (ssh) : Connection refused
> 
> I cant understand why is it. Because I have actually succeeded in test
> 1!

What do get with

   ssh USER@my_home_external_ip ?

> 3. ssh -l USER my_home_external_ip
> ssh: connect to host my_home_external_ip port 22: Connection refused
> This also doesnt work! I thought it should be equivalent to test 1,
> but things just dont work.

'Connection refused' would indicate there is a route to the host but
there is no daemon running on port 22.



Reply to: