I’ve cooked up a Debian 7 virtual machine (with VirtualBox) in an attempt to play with setting up my own server and other such cool tricks. This is all on one computer.
I can SSH into the virtual machine via putty, but after a short (inconsistent duration, ~15 seconds to ~3 mins) period I get booted off the server with the good 'ol error.
Server unexpectedly closed network connection.
Naturally, I just changed my putty settings so that I will send a keepalive every 25 seconds.
This didn’t work, and now I'm straight out of ideas as to what to do to stop this, and I don't know if my error is somewhere in
sshd_config or my putty configurations or any host of other possible things. Spending a while on Google also hasn’t turned up anything.
Looking through my sshd logs, my putty error logs, and my sshd_config isn't showing anything out of the ordinary.
EDIT: Here is my putty error log:
2015-02-20 15:03:28 Looking up host "127.0.0.1" 2015-02-20 15:03:28 Connecting to 127.0.0.1 port 3022 2015-02-20 15:03:28 Server version: SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2 2015-02-20 15:03:28 Using SSH protocol version 2 2015-02-20 15:03:28 We claim version: SSH-2.0-PuTTY_Release_0.63 2015-02-20 15:03:28 Doing Diffie-Hellman group exchange 2015-02-20 15:03:28 Doing Diffie-Hellman key exchange with hash SHA-256 2015-02-20 15:03:28 Host key fingerprint is: 2015-02-20 15:03:28 ssh-rsa 2048 ------------------------------ 2015-02-20 15:03:28 Initialised AES-256 SDCTR client->server encryption 2015-02-20 15:03:28 Initialised HMAC-SHA-256 client->server MAC algorithm 2015-02-20 15:03:28 Initialised AES-256 SDCTR server->client encryption 2015-02-20 15:03:28 Initialised HMAC-SHA-256 server->client MAC algorithm 2015-02-20 15:03:32 Sent password 2015-02-20 15:03:32 Access granted 2015-02-20 15:03:32 Opening session as main channel 2015-02-20 15:03:32 Opened main channel 2015-02-20 15:03:32 Allocated pty (ospeed 38400bps, ispeed 38400bps) 2015-02-20 15:03:32 Started a shell/command 2015-02-20 15:04:56 Server unexpectedly closed network connection
EDIT x3: Here are the relevant results of an example failed session after looking at /var/log/auth.log.
Feb 21 16:16:38 CGIT sshd: Accepted password for web from 10.0.2.2 port 60037 ssh2 Feb 21 16:16:38 CGIT sshd: pam_unix(sshd:session) session opened for user web by (uid=0)
I've reinstalled debian in a new VM instance (this time through a CD install instead of a netinstall) and yet I still get disconnected randomly. This happens when running the VM as admin, and disabling all antivirus.