Sample Header Ad - 728x90

List of Users - RHEL

1 vote
0 answers
1051 views
I want to get list of users - both human and machine who have access to the unix server. OS is:
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
I tried
/etc/passwd
and
passwd
- but both these lists are incomplete. A number of users that have a folder in /home are not present in output of either of the above two commands. I ran
for a username that had a folder but not present in the output of these commands and I got a valid output, proving that that user exists. So, how do I get a list of "all" users of the server.
PS: I do have sudo access. Output of
~> grep passwd /etc/nsswitch.conf
passwd:     files sss
EDIT1: I did some digging and turns out this server uses IPA. I ran
user-find
. It listed 2K users, which I believe is the exhaustive list of users that are created via IPA but not necessarily all of them have access to this particular server. More Background:
Most human users login via either SSH or id + password.
This server is not maintined by any IT/Server team; the business users own the server. People without deep knowledge of servers and systems maintain create users on it. I recently got sudo access and need to 'clean up' the server a little bit - delete users who no longer should have access, identify data that can be archived etc., create proper unix groups to segregate access to data.
Asked by Abhishek Jain (113 rep)
Jun 3, 2021, 03:00 PM
Last activity: Jun 4, 2021, 05:40 AM