We mainly use SSH for the purpose of securely logging into a remote system. Most Linux distributions come with the SSH package, by default. In order to verify whether SSH is currently running, we use the systemctl command; we pass the status option, as follows:
The SSH daemon ssh.service is currently running (particularly, the Secure Shell server). Another method that we can use to verify that the SSH service is running is the netstat command; we pass the ntlp options (n for display port numbers, t for TCP protocol, l for currently listening, and p for program ID/program name), as follows:
root@Linuxplus:/home/philip# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 519/rsyslogd
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 431/systemd...