System Trouble Shooting

TurnToJPG -->

SSHD Timeout


When you login to some remote ssh machine, after 1 or 2 minutes, the server will hint you:
Connection closed by foreign host.


This trouble happens on Ubuntu14.04, because we don’t set the timeout intervals. So we could add following 2 lines into the /etc/ssh/sshd_config

ClientAliveInterval 60
ClientAliveCountMax 3

AliveInterval means we could keep the client alive for 60 minutes. AliveCountMax means when server send 3 times request to ssh client, if client didn’t send back reply message, then the ssh connection will be lost.
Restart the ssh via service ssh restart and now you won’t got this annoying trouble.


Since I use dnsencrypt at home, so once it enabled, all of the query goes to the, I have to turn it back at company.

[Trusty@~]$ cat /etc/resolv.conf
# Generated by resolvconf
search lan
alias disdns='sudo systemctl stop dnscrypt-proxy.service'
$ disdns

By doing this you could reach the internet.