I want to find out which SSH user started my script on a server via SSH, i.e. which public key was used for the user to log in.
SSH_CONNECTION environment variable gives me the client's IP address.
I would also like to know which public key from
authorized_keys was used and its comment (usually email).
I am looking for a solution without fiddling with
sshd and its logs, so that I would not need to set up the target servers. The only thing known for sure is that the script is run on Ubuntu servers. Also my user doesn't have