SSH problem

megamaced

Geek Geek Geek!
I can't seem to connect to my Kubuntu 6.06 computer via SSH. I've configured my laptop (Xubuntu 6.10) and my other desktop (Ubuntu 6.10) with SSH and they can both connect to each other. I can connect to the * 6.10 computers using my Kubuntu desktop. From my Xubuntu machine I get the error:

Code:
"ssh_exchange_identification: Connection closed by remote host"

Any ideas? :)

EDIT: Just thought I'd say the Kubuntu machine is not running a firewall.
 
try ssh in verbose mode [ ssh -v user@host ] ... might give a few clues as to where its failing!

random post/s ive found that might help

In my experience this sort of thing is caused by reverse-dns lookups timing out. Just for kicks, on the machine running sshd, add an entry to your /etc/hosts containing the IP and name of the machine you're having a hard time connecting from (the format for doing so is provided by the localhost entry).
 
This is the output:

Code:
OpenSSH_4.3p2 Debian-5ubuntu1, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.3.61 [192.168.3.61] port 22.
debug1: Connection established.
debug1: identity file /home/david/.ssh/identity type -1
debug1: identity file /home/david/.ssh/id_rsa type -1
debug1: identity file /home/david/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host

Any clues?
 
Code:
ubuntu@ubuntu:~$ ssh -v ubuntu@localhost
OpenSSH_4.3p2 Debian-5ubuntu1, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/ubuntu/.ssh/identity type -1
debug1: identity file /home/ubuntu/.ssh/id_rsa type -1
debug1: identity file /home/ubuntu/.ssh/id_dsa type -1
[B]debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-5ubuntu1[/B]
debug1: match: OpenSSH_4.3p2 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3p2 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /home/ubuntu/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ubuntu/.ssh/identity
debug1: Trying private key: /home/ubuntu/.ssh/id_rsa
debug1: Trying private key: /home/ubuntu/.ssh/id_dsa
debug1: Next authentication method: password
ubuntu@localhost's password:

The line in bold is where the differences start... the remote client is the one that kicking you, and its something to do with a version check...

try the following, and see if you get the same as i did. (only instead of telneting into into your local box, telnet into the remote box)

Code:
ubuntu@ubuntu:~$ telnet 127.0.0.1 22
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-2.0-OpenSSH_4.3p2 Debian-5ubuntu1

what does the remote ssh server report itself as?

[OT]
FYI: Im currently running from a Ubuntu LiveCD
[/OT]
 
I've sorted it!

A bit of Googling suggested I look in the hosts.deny file. I remembered that I set my Kubuntu machine's host.deny file to read 'ALL: ALL', whereas my other computers read 'ALL: PARANOID'. So I made the changes to the Kubuntu box and all is well now.

Thanks for your help
 
no problem, i saw the same advice to check the hosts.x files, but for some reason i didn't even consider the idea that you'd played with them! sorry :/

don't forget the solved button
 
Back
Top