Only the SSH server (sshd
) can retrieve that information. It is not exposed to processes launched from the server, such as the shell.
The fact that Github is doing this, as well as some circumstantial evidence on their blog, strongly suggests that Github is running a custom SSH server (i.e, not OpenSSH). You would need to write your own SSH server to replicate this functionality.