May 2017
Beginner
552 pages
28h 47m
English
A tcp socket connection is opened for every HTTP access, every SSH session, and so on. The -t option reports the status of TCP connections:
$ ss -t
ESTAB 0 0 192.168.1.44:740 192.168.1.2:nfs
ESTAB 0 0 192.168.1.44:35484 192.168.1.4:ssh
CLOSE-WAIT 0 0 192.168.1.44:47135 23.217.139.9:http
This example shows an NFS server connected at IP address 192.168.1.2 and an SSH connection to 192.168.1.4.
The CLOSE-WAIT socket status means that the FIN signal has been sent, but the socket has not been fully closed. A socket can remain in this state forever (or until you reboot). Terminating the process that owns the socket may free the socket, but that's not guaranteed.