LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   ssh issues - can't connect from external network, internal okay (https://www.linuxquestions.org/questions/linux-server-73/ssh-issues-cant-connect-from-external-network-internal-okay-648111/)

dragos19 06-09-2008 03:42 PM

ssh issues - can't connect from external network, internal okay
 
i am having some issues connecting to my server remotely.

ssh -v Admin@remote.dyndns.org
OpenSSH_4.7p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to myserver.dyndns.org [75.51.233.72] port 22.
debug1: Connection established.
debug1: identity file /Users/me/.ssh/identity type -1
debug1: identity file /Users/me/.ssh/id_rsa type -1
debug1: identity file /Users/me/.ssh/id_dsa type 2
ssh_exchange_identification: Connection closed by remote host

when I try to connect from inside the network, it works (e.g. ssh -v Admin@192.168.1.2 gets me to the command line).

any ideas?

snowtigger 06-09-2008 04:04 PM

I'll assume you have a firewall in the way.

Did you forward the ports correctly, it might be trying to connect to ssh on the firewall

:)

dragos19 06-09-2008 04:42 PM

yea, i checked the router (Linksys Wireless-G) and port 22 is pointing to the right place. i tried restarting the router and reapplying the settings as well. no go.

for the record, i have been able to connect remotely before. the only thing that had recently changed is that i started doing passwordless authentication. i'm not sure if that can have anything to do with it, but i have tested this both ways (password auth and dsa) and they both give me the same results.

snowtigger 06-10-2008 02:25 AM

hummmmm interesting.

maybe you have accidently altered a setting in sshd_config and not realised. i would suggest you extract the original sshd_config from the package you installed with and trying with a clean slate. Then going through and try using your keys again.

:)

dragos19 06-10-2008 11:43 AM

okay, i think i got router issues.

i just tried logging in this morning and it worked. when i tried last night it didn't. i didn't make changes; funky router for sure.

i have a networking question. i want to know if my logic is correct here:

when i'm on the local network of my server (or any computer for that matter) and I ssh with the local IP (e.g. 192.168.1.2), that request goes from my computer, to the switch, to the computer i am sshing to. the request never hits the router.

on the other hand, if i am still on the local network and i attempt to ssh to the server via it's dns name (e.g. myserver.dyndns.org), then my request is going out to the Internet, getting the name/IP resolved and forwarded to my router.

is this correct?

snowtigger 06-10-2008 09:13 PM

for your first question, yes.

but your second one is a little trickier. It mainly depends on how your router handles DNS requests. If it just forwards the requests on then you assume right. However if your router caches previous requests then the first time or over a time limit from your first request it behaves like its just forwarding the request, but then after it sees that you have requested the info before and uses that.

:)


All times are GMT -5. The time now is 10:42 PM.