In our setup, we are forced to use Microsoft Active Directory (AD) for ssh access to our Linux VM, so that when employees leave they can be blocked from accessing the VM once their AD account is deactivated.
We already have all our data and users set up. So my proposed plan is to:
Disable all remote / ssh access to the original user accounts, only allowing access via their new AD accounts.
Upon ssh'ing in to their AD account, they are automatically logged in to their original user account.
I need logname
to print out the original user account (i.e. the account they get auto-logged into) and not the new AD account.