Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Custom userinfo.sh

History

I needed to query certain information about a user on a Linux system. Specifically this output:

user: bgstack15
getent: YES
getent_type: sss
can_ssh: YES
can_sss: YES

I wanted to know if a user is defined (getent), and if so, in which database (local or in Active Directory). Also, is the user in the AllowUsers list of the sshd_config, or a member of a group in the AllowGroups list. And then the same question for the sssd config file.

The script

https://gist.github.com/bgstack15/f0696da7d45022df75e81f78146c8080

Comments