Subject: Re: How to set up sshd_config to allow connection via dydns?
To: Alasdair Reed <alasdair@iprimus.com.au>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 06/05/2007 12:30:36
On Tue, 5 Jun 2007 22:56:57 +1000
Alasdair Reed <alasdair@iprimus.com.au> wrote:

> Hi,
> 
> I am want to set up my computer (i386 NetBSD3.0.1) so I can log on
> via ssh from a remote computer. I have a DHCP address so I have set
> up ddclient in conjunction with dyndns. this all seem to be ok,
> pinging my dyndns host address as reported by their 'CheckIP'
> service  works ok 
> 
> At the moment trying to log on from a remote computer  using the
> command 
> 
> 'ssh -v mydyndnshostaddress' 
> 
> produces the following result
> 
> OpenSSH_3.9 NetBSD_Secure_Shell-20050213, OpenSSL 0.9.7d 17 Mar 2004
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: Connecting to mydyndnsaddress[mydyndnsaddress ] port 22.
> debug1: Connection established.
> debug1: identity file /root/.ssh/identity type -1
> debug1: identity file /root/.ssh/id_rsa type -1
> debug1: identity file /root/.ssh/id_dsa type -1
> ssh_exchange_identification: Connection closed by remote host
> 
> /var/log/authlog reports the home machine is listening on port 22
> 
> but does not report any attempts to log in via ssh
> 
> uncommented lines in etc/ssh/sshd_config are as follows:
> 
> Port 22
> Protocol 2,1
> ListenAddress 0.0.0.0
> UsePam yes
> 
> Nothing is uncommented in /etc/ssh/ssh_config
> 
> I have looked at the various man pages and various web pages,I
> suspect that my config files are set up far to minimally  but seem
> unable to find a clear answer to this hiccup. Any help will be most
> gratefully received.
> 
Try running 

	/usr/sbin/sshd -e -d -D

to get the server's view of what happened.

I don't know what your problem is, but it's quite unlikely to have
anything to do with dydns if that part is set up properly -- and from
what you say, it probably is.  (A better way to check that is to look
at the interface address on your home machine via ifconfig, and see
what address you see on the outside via, say, 'dig', or even the
output from ping.)



		--Steve Bellovin, http://www.cs.columbia.edu/~smb