A server with SSH open to the internet gets knocked on all day. lastb shows who tried and failed, if the system recorded it.
sudo lastb | head -n 20
sudo lastb -i | head
The util-linux manual says lastb is the same as last, except that by default it shows the log in /var/log/btmp, which holds all the bad login attempts. It needs root, since that file is not readable for normal users.
Useful options come from last: -i shows the IP address instead of a hostname, -s sets a start time, and -f reads another file, such as a rotated one.
It is a quick sanity check after you changed something. If you turned off password logins for SSH, you expect the same attempts to keep coming, but none should succeed.
The caveat is that the log may be empty or missing. The file does not exist if nothing was ever written to it, and a guide I read notes that failed SSH logins are not always recorded in btmp, depending on the configuration. So an empty result does not prove nobody tried. On a systemd machine the journal is the other place to look, with journalctl -u ssh, whose unit is called sshd on some distributions.
Further reading: last(1) manual, util-linux