# SSH fails to give a shell, connection reset by peer

## Dizzutch

All,

    For the last week or so I have been struggling with the following problem. When I try to SSH to my home from my work I am presented with the following debug output

```
jule@leiden ~/shared $ ssh -p 443 -vvv xxxxxxx.com

OpenSSH_4.3p2, OpenSSL 0.9.7j 04 May 2006

debug1: Reading configuration data /etc/ssh/ssh_config

debug2: ssh_connect: needpriv 0

debug1: Connecting to xxxxxxx.com [24.177.xxx.xxx] port 443.

debug1: Connection established.

debug1: identity file /home/jule/.ssh/identity type -1

debug1: identity file /home/jule/.ssh/id_rsa type -1

debug1: identity file /home/jule/.ssh/id_dsa type -1

ssh_exchange_identification: read: Connection reset by peer

```

Initially my thoughts were that etc-update must have changed something, but the sshd_config file has not been altered since July. Portmaps hosts.allow is set to ALL:ALL and hosts.deny is not present on the system.

Are there any other places I can check to get any idea why this is happening? Or any other programs that might be causing this to happen? I'm pretty much stuck here.

Any ideas are welcome.

Thanks!

-Dizz

----------

## Watson

guess its the same problem as mine:

https://forums.gentoo.org/viewtopic-t-499331.html

----------

## Dizzutch

I'll give that a try, was that on the server or on the client that you re-emerged openssl and openssh?

----------

## Watson

server

----------

## Dizzutch

yeah, so reemerging these things didn't work. I also noticed that you problem is different than mine, since my connection gets closed by peer, and you're by remote host, although it does happen at the same time.

----------

## cow_n_chicken

Hi, 

did you get a solution now? 

I have the same problem with one of our gentoo-Clients. 

If I try to connect by ssh I'm getting following Errormessage:

ssh_exchange_identification: read: Connection reset by peer

SSH-Version: openssh-4.3_p2-r1

If somebody restarts the device I can connect exactly one time. 

And after 5 min the connection is closed automatically. 

I deleted my .ssh folder. And it's the same image like on our other

devices. And I also reemerged the openssh package. 

Does somebody have a Solution ??? 

Thanks 

cow n chicken

----------

## Dizzutch

I do not have a solution. I am thinking that my company has a firewall in place that is blocking this traffic, for I can connect just fine from anywhere else.

-dizz

----------

## Janne Pikkarainen

 *Dizzutch wrote:*   

> I do not have a solution. I am thinking that my company has a firewall in place that is blocking this traffic, for I can connect just fine from anywhere else.
> 
> -dizz

 

Actually your problem does not sound like a firewall problem, since the initial connection goes fine and only fails during negotiation. Have you tried to 

```
cd ~

mv .ssh .ssh.bak

ssh your.problematic.server
```

to see, if something in your ssh settings and other stored data isn't causing some incompatibilities?

----------

## cow_n_chicken

Well I tried to mv the .ssh folder. 

But its still the same problem. 

I noticed that I can connect sometimes, its not only after rebooting the machine. 

If I can connect, its mostly only for 1 - 5 minutes. The conection is closed automatically. 

I have no clue what the hell is up there. 

Does somebody ever have such a problem? ?

----------

## Dizzutch

same here, i've recompiled ssh/ssl on both machines, deleted the .ssh folder. perhaps my work firewall is blocking the authentication packets. That's why i can get through the initial connection, but once i start authenticating it gets blocked.

----------

## bluedevils

hmmm....and your nic settings (speed/duplex) are correct? Does /var/log/messages tell you anything?

----------

## Dizzutch

Nothing at all, I can SSH everywhere else locally, externally i can't ssh to anything over port 22, hence me using 443

----------

