At home we have 2 machines, on a local ethernet network.
Both are running Red Hat 6.2, and both have very similar config files
(with the appropriate substitutions for machine names and static IP
addresses).  /etc/resolv.conf in both cases say to look at files before
going for bind.  Both are running the same versions of openssh and
openssl.

On "posh", if I run ssh -v "coo", it tries to connect straight away.
But the reverse, on "coo" (ssh -v "posh"), hangs for about 2 minutes
while it tries a DNS lookup.  Strange, because the info is in
/etc/hosts (on both machines)!  This is further confirmed by doing an
ssh from coo to posh's IP address - there's no pause then.

An strace on posh (the non-hanging one), shows that after reading
/etc/hosts, it does a uname, and then tries to connect to coo's IP
address:

open("/etc/hosts", O_RDONLY)            = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=153, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40015000
read(3, "192.168.1.1\tposh posh.localdomai"..., 4096) = 153
close(3)                                = 0
munmap(0x40015000, 4096)                = 0
uname({sys="Linux", node="posh", ...})  = 0
write(2, "debug: ", 7debug: )                  = 7
write(2, "Connecting to coo [192.168.1.3] "..., 42Connecting to coo [192.168.1.

But on coo (the 2-minute hanging one), ssh does not follow up with a
call to uname, and doesn't try to connect to posh's IP address (obviously
hasn't found it), so it then starts loading up various nis -type shared
libraries.

Any idea why that would be so?

posh's /etc/hosts looks like this:

192.168.1.1     posh.localdomain        posh
127.0.0.1       localhost.localdomain   localhost       posh
192.168.1.3     coo.localdomain         coo
192.168.2.1     diald.localdomain       dialdslip

coo's one looks like this:

192.168.1.3     coo.localdomain         coo
127.0.0.1       localhost.localdomain   localhost       coo
192.168.1.1     posh.localdomain        posh

I'm completely stumped.


An ssh problem solved
---------------------

BTW, eventually solved a follow-on problem where ssh wouldn't let me
login.  It just gave the error "Access denied".  /var/log/messages on
the remote machine showed that PAM was rejecting the login with the
error "User account has expired".

I eventually worked out that this actually meant "You haven't created a
policy for ssh logins", i.e. no /etc/pam.d/ssh (and sshd?) "policy"
config file.

luke




-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to