If you are on the server, look at the process attached to the network port where
ssh is expected (
22 or something else).
You can use
ss for that. You will then be able to find the full command line of the running server which may be enough to identify it or else you may use to other options:
strings on it is really the last course of actions but can yield results (you will most certainly find back also the string that is reported by the server remotely, as other answers show)
- you can find the open files the process has (look in
/proc/$PID/fd) which may yield either a link to a configuration file, or a logfile, and ideally the logfile would give enough information to pinpoint what process this is.
Or depending on your system and setup, for example you can use
systemctl list-units to see exactly what runs currently, and what is the
ssh server (then by inspecting
systemd unit file you will see what command line it is, and other information)
If you are external to the server, then see other answers, but there is no guarantee that was is returned from remote server is the truth, it can displays itself as whatever it wants.
Another option remotely would be to do some "SSH fingerprinting". I haven't seen that directly, but I am sure it exists. Basically by testing various types of connections, one can determine some info from the remote part, besides what it claims to be. I guess multiple vulnerability scanners have things like that.