Form the manpage we can read that you can set environment variables in the authorized_keys file for every key. For this to work you need to set
PermitUserEnvironment yes
in /etc/ssh/sshd_config
and restart your ssh server.
Then add an environment="name=value"
in front of the ssh public key in the authorized_keys file
, like this for example:
environment="sshuser=user1" ssh-rsa AAAA...
If you then log in to the server you can access the env variable:
$ ssh server
$ echo $sshuser
user1
Hope it helps!