linux check all ssh connections code example Example 1: list all ssh connections ubuntu ss | grep -i ssh Example 2: check active number of ssh connections last -a | grep -i still