You are not logged in.

#1 2009-11-08 18:46:22

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 325

ssh: configuration to access from remote

Hi guys, I know there are existing discussions on this...but i can't come up to solve my problem.
Let me explain: i want to connect from outside to my home pc internal to my home-lan.

I have a classic lan and a router which is visible from outside using the following address

http://mynetworkname.dyndns.org:8080/

Typing this address I can access to the router login admin page.

Now i want to connect through ssh to my pc with ip 192.168.0.2.
Therefore I created a virtual server with the following rule:
IP 192.168.0.2 intPort=22 externPort=60002

But how can i access through ssh to my machine?
typing

ssh -p 60002 http://mynetworkname.dyndns.org

i get the following error message:
ssh: Could not resolve hostname http://mynetworkname.dyndns.org: Name or service not known

In fact that address doesn't exist (?why?), but also trying

ssh -p 60002 http://mynetworkname.dyndns.org:8080

i get the same error:
ssh: Could not resolve hostname http://mynetworkname.dyndns.org:8080/: Name or service not known

I can't understand how to do.

Where's my mistake?

Thanks in advance

Last edited by virusso80 (2009-11-08 18:48:57)

Offline

#2 2009-11-08 19:03:56

ugaciaka
Member
From: Italy
Registered: 2008-07-06
Posts: 140
Website

Re: ssh: configuration to access from remote

ssh -p 60002 http://mynetworkname.dyndns.org:8080

port 600002 or 8080? lol

try

 ssh mynetworkname.dyndns.org

and you must decide which port is listening on the server!

EDIT but honestly I do not understand how you have configured your router. Make it classic. Ssh is listening on port 22 by default (/etc/ssh/sshd_config) on the router then open the 22 inbound to your PC where there is an ssh server (aka port forwarding).

Last edited by ugaciaka (2009-11-08 19:07:06)


I have never bought on ebay, the macbook I do not like, I do not need facebook or myspace or secondlife
I am not a nerd or lamer or troll or geek or hacker or cracker
and I have never voted to elect berlusconi

Offline

#3 2009-11-08 19:38:23

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 325

Re: ssh: configuration to access from remote

ugaciaka wrote:
ssh -p 60002 http://mynetworkname.dyndns.org:8080

port 600002 or 8080? lol

try

 ssh mynetworkname.dyndns.org

and you must decide which port is listening on the server!

EDIT but honestly I do not understand how you have configured your router. Make it classic. Ssh is listening on port 22 by default (/etc/ssh/sshd_config) on the router then open the 22 inbound to your PC where there is an ssh server (aka port forwarding).

Thanks for your answer.

The problem is that just using default settings typing
http://mynetworkname.dyndns.org i didn't get anything!!

adding ...org:8080 i get the login page for my router.

My lan is composed by3 pcs and i would like to access to the one with ip 192.168.0.2.

Therefore I created the rule with the following settings:
IP 192.168.0.2 intPort=22 externPort=60002

does it mean i have opened port 60002 from outside that is forwarded to 22 on the real system with ip 192.168.0.2? I think so.

Now the problem is that I don't know how to access the pc. I also tried with the ip address got from http://www.whatismyip.com/.

I don't know what to check.

Moreover if i try to ping my wan-ip address (the router address) it's ok.

Just a question now: when i set the port forwarding i have to select the protocol. Is it correct to choose both TCP&UDP?

Thanks - grazie smile

Offline

#4 2009-11-10 04:59:41

kermana
Member
Registered: 2009-04-13
Posts: 60

Re: ssh: configuration to access from remote

TCP & UDP should be fine. As far as I know ssh only uses TCP but doesn't hurt to forward both I guess smile I think the command you are looking for is

ssh -p 60002 mynetworkname.dyndns.org

Last edited by kermana (2009-11-10 06:13:20)

Offline

#5 2009-11-10 08:34:06

skipio
Member
Registered: 2009-01-27
Posts: 12

Re: ssh: configuration to access from remote

Open you router admin page and set port forwarding for 192.168.0.2 tcp 60002 (60002 is fine for both internal and external, no need to do a port translation).
do the following for your home pc:
set 'port 60002' in your /etc/ssh/sshd_config
put 'sshd: 192.168.0.1' (or whatever is your local router address) in /etc/hosts.allow
/etc/rc.d/sshd start (on both machine)

connect by: ssh -p 60002 mynetworkname.dyndns.org

Offline

#6 2009-11-10 08:35:52

virusso80
Member
From: Italy
Registered: 2007-03-09
Posts: 325

Re: ssh: configuration to access from remote

kermana wrote:

TCP & UDP should be fine. As far as I know ssh only uses TCP but doesn't hurt to forward both I guess smile I think the command you are looking for is

ssh -p 60002 mynetworkname.dyndns.org

I think I've already tried

skipio wrote:

Open you router admin page and set port forwarding for 192.168.0.2 tcp 60002 (60002 is fine for both internal and external, no need to do a port translation).
do the following for your home pc:
set 'port 60002' in your /etc/ssh/sshd_config
put 'sshd: 192.168.0.1' (or whatever is your local router address) in /etc/hosts.allow
/etc/rc.d/sshd start (on both machine)

connect by: ssh -p 60002 mynetworkname.dyndns.org

So what you mean is to change the default port for ssh on my host. mmm  I got it no port translation. Is it the classical solution?
Thanks for your suggestion! I'll let you know when i'll go back home during the week end!

Last edited by virusso80 (2009-11-10 08:39:39)

Offline

#7 2009-11-10 12:01:08

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: ssh: configuration to access from remote

Mind you that some things don't seem to like forwarding from/to different ports eg. (inside) 22<->60002 (outside), I don't know if it is the case with ssh but if you want to change the port make it the same everywhere.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB