AuthorizedKeysCommand in OpenSSH without user
Solution 1:
If you mean a non-local user, yes, it is perfectly possible, freeIPA
, for example, can store users' public keys in its LDAP backend:
ipa user-mod user –sshpubkey='ssh-rsa AAAA…'
and uses:
AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys
AuthorizedKeysCommandRunAs nobody
in /etc/ssh/sshd_config
effectively delegating the validation of authorized keys to `sssd', which in turn is configured to contact the freeIPA server.
References from the freeIPA
site here.