What sshd does for every connection, even ones that never log in
Why that shows up as load, memory pressure, and swap
Reading auth.log or the journal for failed sshd logins
BASH
# Count failed attempts in the current log file (Debian/Ubuntu)
sudo grep -cE 'Failed password|Invalid user' /var/log/auth.log
# Same on RHEL-family systems
sudo grep -cE 'Failed password|Invalid user' /var/log/secure
# Journal, limited to a time window (use -u sshd on RHEL-family)
sudo journalctl -u ssh --since '10 minutes ago' --no-pager | grep -cE 'Failed password|Invalid user'
# Top source IPs by failed password count
sudo grep 'Failed password' /var/log/auth.log | grep -oE 'from [0-9.]+' | sort | uniq -c | sort -rn | headTEXT
# Illustrative output format (IPs from documentation ranges)
sshd[2101]: Invalid user admin from 203.0.113.45 port 51122
sshd[2101]: Failed password for invalid user admin from 203.0.113.45 port 51122 ssh2
sshd[2140]: Failed password for root from 198.51.100.7 port 40318 ssh2
sshd[2140]: error: maximum authentication attempts exceeded for root from 198.51.100.7 port 40318 ssh2 [preauth]
sshd[987]: drop connection #10 from [203.0.113.80]:39004 on [192.0.2.10]:22 past MaxStartupsTying the log entries to processes and connections
BASH
# All sshd-related processes with age, CPU, and memory (RSS in KB)
ps -eo pid,ppid,etimes,pcpu,rss,args | grep -E '[s]shd'
# Established TCP connections to port 22 (output includes one header line)
ss -tn state established '( sport = :22 )' | wc -l