I'm connecting to a remote server, but want to make sure that they keys have been created relatively recently. How can I tell when the keys for that ssh server were generated?
If I can't check remotely, is there a way to use tools to check the server's keys age locally?
ls -l /etc/ssh/ssh_host* perhaps?
There is no guarantee that they aren't old though.
If you are trying to detect someone being nefarious there really isn't anything stopping them from changing the date on those files. The only real way is to keep your own list/database with the key and the date it was added.
Using something with ssh-keyscan you could cook up a pretty quick solution to scan your whole network and store the information into say an sqlite db file with a date.