problem specifying port to ssh

Don Cohen don-temp28 at
Fri Apr 7 10:32:02 EST 2006

Darren Tucker writes:
 > Don Cohen wrote:
 > > Damien Miller writes:
 > >  > It looks like your /etc/nsswitch.conf or one of the supporting libraries
 > >  > is messed up - it is failing inside a getaddrinfo() call, probably 
 > >  > in /lib/
 > > 
 > > I actually did look at that.
 > > This from dired of /etc
 > >   -rw-r--r--    1 root    root      1750 Sep  8  2005 nsswitch.conf
 > >   -rw-r--r--    1 root    root      1696 Sep 22  2004 nsswitch.conf.rpmnew
 > > suggests that on Sep 8 that file was replaced.
 > No, it suggests that it was replaced with a file that was last modified
 > on Sep 8 2005.  When that occurred is not necessarily the same time
 > (compare with the inode creation time: "ls -lc").

 $ ls -lc /etc/nsswitch.conf
 -rw-r--r--    1 root     root         1750 Sep  8  2005 /etc/nsswitch.conf

Never the less, switching these two files does seem to solve the
problem.  The man page is not very clear on what all this means.
Here are the differences - is what works, + is what doesn't.
I'd have expected that "files" would give one way to do a lookup and
"files nisplus" would only give another way when the first failed.
So I expected the new file to work in a SUPERset of cases of the old
one, not a strict SUBset.  What is the truth of the matter (and where
can I see it other than asking)?

 --- /etc/nsswitch.conf	2004-09-22 18:17:12.000000000 -0700
 +++ /etc/	   2005-09-08 15:18:43.000000000 -0700

 -passwd:     files
 -shadow:     files
 -group:      files
 +passwd:     files nisplus
 +shadow:     files nisplus
 +group:      files nisplus

 -hosts:      files dns
 +hosts:      files nisplus dns

The problem seems to be that nisplus comes before dns above.
If I add nisplus at the end things still work,
if I put it before dns then they don't.
So perhaps nisplus fails in some way that causes dns to not be
attempted?  And what is this nisplus anyhow?  Is it supposed to 
be installed, configured and running in every linux?  If it's not
perhaps that's the problem?  

 -protocols:  files
 +protocols:  files nisplus

 -services:   files
 +services:   files nisplus

 -netgroup:   nisplus
 +netgroup:   files nisplus

 > You might also want to check the "services" entry in nsswitch.conf.
I gather that adding nisplus gives an alternative way of finding
a service if not in /etc/services.  But I don't see what you thought
might be there or what I was supposed to look for.

 > > But I don't understand how this is related to supplying a port.
 > The port number is passed to getaddrinfo() along with the hostname.  It
 > would appear that your system can handle hostname alone, but isn't happy
 > with both.
You mean I can somehow arrange that 
 ssh -p 22
and ssh -p 2222
resolve to different IP addresses?  How?

Thanks for your help.

More information about the openssh-unix-dev mailing list