Since a few days I'm facing an issue while being connected to my server in ssh, for proxy/tunel usage.I - SetupClientHere is the machine :iMac:~ Luca$ sw_versProductName:  Mac OS XProductVersion:   10.11.6BuildVersion: 15G1108iMac:~ Luca$ sudo sysctl net.inet.ip.forwardingnet.inet.ip.forwarding: 0iMac:~ Luca$ sudo sysctl net.inet.ip.fw.enablenet.inet.ip.fw.enable: 1Tried on three different network.BrowserI'm using Firefox 50.0.1 to browse internet, with the FoxyProxy extension configured like so :host address : 127.0.0.1port : 9999socks v5SSH commandI'm using Terminal.app to connect in ssh to my server.iMac:~ Luca$ ssh -p 53 -D 9999 luca@myIPServerluca@myServer:~$ ssh -VOpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016luca@myServer:~$ cat /proc/sys/net/ipv4/ip_forward1II - ExpectedOnce the connection is open, I can browse any website without any issue (with my IP being my server one).This was fine until a few days.This is still fine if I try :same server (A), another computer (Y)same computer (X), another server (B)From what it looks like, it doesn't work with my computer (X) and my server (A).III - What happensluca@myServer:~$ ssh_dispatch_run_fatal: Connection to myIP: message authentication code incorrectThe connection is then closed.This message appears at random time. But I can reproduce it easily with a big data load through the proxy : load multiple videos, download big files, etc...IV - Another way, similar problemIf I connect to my server through sftp:// (with FileZilla) with the same login (luca) and same port (53). Then I try to download a file, every <30 seconds I get the following error :Error : Incorrect MAC received on packetOnce again, this happen only with my computer (X) and my server (A).If I try another server (B) on the same computer (X) : no problem.If I try the same server (A) on another computer (Y) : no problem.V - What I've tried (and didn't fix)Reboot the server and the computerRestart ssh/sshd on both the server and the computerDelete the knowns_hosts file on the computerSpecify a -m and -c with the ssh commandSpecify a -o GSSAPIKeyExchange=no within the ssh commandUncomment the Ciphers and/or MACs lines within /etc/ssh/ssh_config on the server or/and the computerTried to look at -vvvvv option with the ssh command and read logs on server/computer, nothing looked related. Any help would be appreciated.APPENDIXServer ssh -Q macluca@myServer:~$ ssh -Q mac  hmac-sha1  hmac-sha1-96  hmac-sha2-256  hmac-sha2-512  hmac-md5  hmac-md5-96  hmac-ripemd160  hmac-ripemd160@openssh.com  umac-64@openssh.com  umac-128@openssh.com  hmac-sha1-etm@openssh.com  hmac-sha1-96-etm@openssh.com  hmac-sha2-256-etm@openssh.com  hmac-sha2-512-etm@openssh.com  hmac-md5-etm@openssh.com  hmac-md5-96-etm@openssh.com  hmac-ripemd160-etm@openssh.com  umac-64-etm@openssh.com  umac-128-etm@openssh.comComputer ssh -Q maciMac:~ Luca$ ssh -Q mac  hmac-sha1  hmac-sha1-96  hmac-sha2-256  hmac-sha2-512  hmac-md5  hmac-md5-96  hmac-ripemd160  hmac-ripemd160@openssh.com  umac-64@openssh.com  umac-128@openssh.com  hmac-sha1-etm@openssh.com  hmac-sha1-96-etm@openssh.com  hmac-sha2-256-etm@openssh.com  hmac-sha2-512-etm@openssh.com  hmac-md5-etm@openssh.com  hmac-md5-96-etm@openssh.com  hmac-ripemd160-etm@openssh.com  umac-64-etm@openssh.com  umac-128-etm@openssh.comServer ssh -v -p 53 -D 9999 luca@myIPiMac:~ Luca$ ssh -v -p 53 -D 9999 luca@myIPOpenSSH_6.9p1, LibreSSL 2.1.8debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 21: Applying options for *debug1: Connecting to myIP [myIP] port 53.debug1: Connection established.debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_rsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_rsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_dsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_dsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_ecdsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_ecdsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_ed25519 type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/Luca/.ssh/id_ed25519-cert type -1debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_6.9debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH* compat 0x04000000debug1: Authenticating to myIP:53 as 'luca'debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client chacha20-poly1305@openssh.com <implicit> nonedebug1: kex: client->server chacha20-poly1305@openssh.com <implicit> nonedebug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug1: Server host key: ecdsa-sha2-nistp256 SHA256:DUAAYL1r0QUDtRI89JozTTz+bm5wcg4cOSaFaRdbr/Ydebug1: Host '[myIP]:53' is known and matches the ECDSA host key.debug1: Found key in /Users/Luca/.ssh/known_hosts:1debug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickey,passworddebug1: Next authentication method: publickeydebug1: Trying private key: /Users/Luca/.ssh/id_rsadebug1: Trying private key: /Users/Luca/.ssh/id_dsadebug1: Trying private key: /Users/Luca/.ssh/id_ecdsadebug1: Trying private key: /Users/Luca/.ssh/id_ed25519debug1: Next authentication method: passwordluca@myIP's password:debug1: Authentication succeeded (password).Authenticated to myIP ([myIP]:53).debug1: Local connections to LOCALHOST:9999 forwarded to remote address socks:0debug1: Local forwarding listening on ::1 port 9999.debug1: channel 0: new [port listener]debug1: Local forwarding listening on 127.0.0.1 port 9999.debug1: channel 1: new [port listener]debug1: channel 2: new [client-session]debug1: Requesting no-more-sessions@openssh.comdebug1: Entering interactive session.debug1: Sending environment.debug1: Sending env LANG = fr_FR.UTF-8Debian GNU/Linux 8.6Linux <server> #1 SMP Tue Mar 18 14:48:24 CET 2014 x86_64 GNU/Linuxserver    : 274305hostname  : myServereth0 IPv4 : myIPv4eth0 IPv6 : myIPv6Last login: Thu Dec  8 15:36:09 2016 from XXX.XXX.XXX.XXXluca@myServer:~$Error I see sometimeluca@myServer:~$ Bad packet length 3045540078.padding error: need -1249427218 block 8 mod 6ssh_dispatch_run_fatal: Connection to 5.39.88.21: message authentication code incorrectServer ssh -o macs=hmac-sha1 -v -p 53 -D 9999 luca@myServer when crash happensiMac:~ Luca$ ssh -o macs=hmac-sha1 -v -p 53 -D 9999 luca@myIP// [...]luca@myServer:~$ debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 3: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 4: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 5: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 6: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 7: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 8: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 9: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 10: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 11: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 12: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 13: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 14: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 15: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 16: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 17: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 18: new [dynamic-tcpip]debug1: Connection to port 9999 forwarding to socks port 0 requested.debug1: channel 19: new [dynamic-tcpip]ssh_dispatch_run_fatal: Connection to myIP : message authentication code incorrectiMac:~ Luca$After updating SSH on client-sideiMac:~ Luca$ ssh -VOpenSSH_7.3p1, OpenSSL 1.0.2j  26 Sep 2016iMac:~ Luca$ ssh -p 53 -D 9999 luca@myIPluca@myIP's password: luca@ns3274305:~$ ssh_dispatch_run_fatal: Connection to myIP port 53: message authentication code incorrectiMac:~ Luca$ ssh -o macs=hmac-sha1 -p 53 -D 9999 luca@myIPluca@myIP's password: luca@ns3274305:~$ ssh_dispatch_run_fatal: Connection to myIP port 53: message authentication code incorrectiMac:~ Luca$
ssh_dispatch_run_fatal: message authentication code incorrect
ssh;ssh tunneling;sftp
I've updated from Mac OS El Capitan (10.11) to Mac OS Sierra (10.12).The problem doesn't occur anymore.I still don't know what the problem really was.