SSH connection problem – allowed from LAN but not WAN

arch-linuxssh

I tried to setup my Arch Linux installation to be an SSH host, but here is the thing:

I can ssh localhost, it fails to login via public key and asks for username and password, but still able to login.

When I try ssh my_wan_ip it gives ssh_exchange_identification: Connection closed by remote host error. I've read all topics about this error and none helped me. By the way, just confirmed, it gives ssh: connect to host my_dyndns_hostname port 22: Connection refused from another machine (outside of my network, it has different wan ip).

I have sshd: ALL in "hosts.allow", ALL:ALL in "hosts.deny".
I am able to connect to my own pc via ssh, ping my own pc, but my ssh setup seems to be the problem, it gives that annoying error when I try to ssh from wan.

/etc/ssh/ssh_config
/etc/ssh/sshd_config

And finally, here is the debug output for both sshd and ssh: (i ran ssh command and i took output to sshd debug after that):

sshd debug
ssh debug

I can edit my question according to your needs. Just ask for any more information needed. BTW I have no iptables running. I have one cable dsl modem connected to a asus wl-330gE wireless access point, they both have their firewall disabled. I configured NAT so port 22 is directed to the pc I'm having this trouble.

Any help appreciated, thanks..

Best Answer

I noticed these lines in your ssh client debug output (lines 28-29):

debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/kerem/.ssh/id_dsa" as a RSA1 public key

So, may be the reason is with the keys on your client machine? Try to regenerate them this way:

ssh-keygen -t rsa
ssh-keygen -t dsa

I also would backup the old ones. Just in case.

Related Topic