System Trouble Shooting

TurnToJPG -->


SSHD Timeout

Trouble

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

Solution

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.

DNS

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

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

By doing this you could reach the internet.