LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Freshly installed Debian 4.0 only accepting ssh connection from PuTTY. (https://www.linuxquestions.org/questions/debian-26/freshly-installed-debian-4-0-only-accepting-ssh-connection-from-putty-570895/)

Zombie13 07-20-2007 05:13 AM

Freshly installed Debian 4.0 only accepting ssh connection from PuTTY.
 
I've installed Debian 4.0 onto my Sun Ultra5, choosing the Desktop Environment, Web Server, and File Server configuration. After this, I installed ssh by doing "apt-get install ssh".

My Windows XP machine can connect to it fine using PuTTY, but using ssh from a command line in Fedora Core on the same machine results in "Connection closed". I've also tried this from my Mandriva machine, and I'm still getting the same. I'm guessing it's something to do with either the protocols or the keys.

Can anyone give me a few suggestions?

Cheers,
Zomb.

rupertwh 07-20-2007 06:07 AM

Is there any type of error message besides "Connection closed"?
Try connecting with 'ssh -v' (up to three '-v' for more verbosity). Maybe that'll shed some light on it.

Telemachos 07-20-2007 06:09 AM

I've never had any problems like that with the default Debian settings. Until I change all the ports, I can use ssh from any other machine as normal. Is it possible your problem has something to do with a router? Either way, you can check your basic settings at /etc/ssh/sshd_config. If you made settings of your own, the config file will be in your /home/you/.ssh/ directory.

Zombie13 07-20-2007 08:12 AM

Thanks for the replies, peeps. My Windows XP and Fedora Core 6 installation are on the same PC, with the same IP etc. PuTTY under Windows works (using ssh 2 protocol), but ssh from a command line in Fedora doesn't. I've also tried "ssh -2 sun-z13" from the Fedora command line.

I've tried "ssh -v sun-z13" as suggested...
Quote:

OpenSSH_4.3p1, OpenSSL 0.9.7g 11 Apr 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to sun-z13 [192.168.0.6] port 22.
debug1: Connection established.
debug1: identity file /home/rich/.ssh/identity type -1
debug1: identity file /home/rich/.ssh/id_rsa type -1
debug1: identity file /home/rich/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-9
debug1: match: OpenSSH_4.3p2 Debian-9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
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 'sun-z13' is known and matches the RSA host key.
debug1: Found key in /home/rich/.ssh/known_hosts:3
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
Connection closed by 192.168.0.6
I know this has gotta be something simple. :confused:

AlucardZero 07-20-2007 10:39 AM

Anything in /var/log/auth.log?

IsaacKuo 07-20-2007 10:48 AM

Why are you all suspecting something wrong with the Debian ssh server? If PuTTY can connect to it, then obviously it's working. The ssh CLIENT settings in Fedora Core and Mandriva are the obvious suspects.

My guess is that both FC and Mandriva have the ssh client configured for key based instead of password based authentication. By default, Debian's openssh-server installs with password based authentication.

Zombie13 07-21-2007 09:15 AM

Cheers, IsaacKuo. That's what I was thinking (client problem), but isn't key based authentication for when you don't want to use a password to log in? I don't want that, I just want to be able to ssh into the box just like I do to my Mandriva and Fedora boxes.

I can't believe this is a problem, such a fundamentally simple task...

Cheers,
Zomb.

Telemachos 07-22-2007 07:01 AM

Quote:

Originally Posted by Zombie13
but isn't key based authentication for when you don't want to use a password to log in?

Key based authentication can work either way: with a password or without. Although a lot of people do it without a pass because it's quicker, I prefer to have a password for the key since it's more secure.

Have you checked the default client settings on your other distros?

uselpa 07-22-2007 07:34 AM

You said XP and FC share the same IP? That might be the source of the problem. Check the sshd log details.

Zombie13 07-23-2007 11:30 AM

Thanks for the reply, but I don't understand how having one of my machines dual-booted with XP and FC could be the problem. Using PuTTY under Windows on that machine works fine, but using ssh on the FC command line on the same machine results in "Connection closed". Doesn't that prove that it's a configuration problem on either the ssh server on the Debian box, or the ssh client on FC (and also on my Mandriva box)?

Cheers,
Zomb.

AlucardZero 07-23-2007 12:54 PM

Is there anything at the time of the connection attempt(s) in /var/log/auth.log on the Debian server?

uselpa 07-23-2007 01:08 PM

Quote:

Originally Posted by Zombie13
Thanks for the reply, but I don't understand how having one of my machines dual-booted with XP and FC could be the problem.

Depending on how you connect, the first time an IP address is seen by a sshd it keeps some information. When this information doesn't match later on, it thinks it's some kind of attack.

Just change the IP address of your Fedora installation to an IP address you haven't used to connect to sshd and try again.

makuyl 07-23-2007 02:16 PM

I'd start by deleting the ~/.ssh/known_hosts file on the Fedora box.


All times are GMT -5. The time now is 11:03 PM.