# How to solve ssh disconnect packet corrupt problems

**URL:** <https://linux-tips.com/t/how-to-solve-ssh-disconnect-packet-corrupt-problems/258>\
**Category:** Network\
**Created:** [July 3, 2015, 1:42pm UTC](https://linux-tips.com/t/how-to-solve-ssh-disconnect-packet-corrupt-problems/258 "2015-07-03T13:42:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [July 3, 2015, 1:42pm UTC](https://linux-tips.com/t/how-to-solve-ssh-disconnect-packet-corrupt-problems/258/1 "2015-07-03T13:42:13Z")

</div>

If you get following errors from an active ssh connection:

```
Bad packet length 0.
Disconnecting: Packet corrupt

```

it is related with packet corruption in MAC level.

Your network card may be buggy or you may have cable issues but most probably if you disable the hardware checksum offloading on the network interface it will start to work again.

Please note that, it is hard to reproduce the “Packet corrupt” error in ssh but if you try to get big TCP packets like running `dmesg` command or `lsof -n`, you may reproduce the problem easily.

In order to disable hardware checksum offload on an interface you can use `ethtool` like below:

```
$ sudo ethtool -K eth0 tx off rx off

```

If you want to run ethtool automatically on next boot, you can write an up hook in `/etc/network/interfaces` file on Debian based systems like that:

```
iface eth0 inet static
...
    up /sbin/ethtool -K eth0 tx off rx off

```

You can learn more about segmentation and checksum offloading here: [http://sandilands.info/sgordon/segmentation-offloading-with-wireshark-and-ethtool](http://sandilands.info/sgordon/segmentation-offloading-with-wireshark-and-ethtool)
