
This forum is proudly powered by Scientific Linux 6 | SL website Download SL Help Search Members |
Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
dp022 |
Posted: Nov 28 2012, 02:57 PM
|
|
SLF Newbie Group: Members Posts: 6 Member No.: 2090 Joined: 28-November 12 ![]() |
How to find active, inactive and hidden users in redhat linux?
Thanks in Advance ![]() |
|
zxq9 |
Posted: Nov 28 2012, 11:52 PM
|
|||||||||||
![]() SLF Geek ![]() ![]() ![]() ![]() Group: Members Posts: 321 Member No.: 611 Joined: 5-August 11 ![]() |
You didn't give much background on your situation, so I'll assume you're looking for all users in a system that is getting its user data from itself (as in, no LDAP, Kerberos, NIS, or anything else going on).
User information is stored in /etc/passwd and group information is stored in /etc/group. Most administrators just read these directly:
Learning why each user exists, on the other hand, is a subject best explored first through the system documentation. I prefer the Fedora 14 docs myself, so here are the pages on the standard users and the standard groups that can/will be found on a system. A lot of these are only going to exist if you install the package(s) that depends on them, so don't expect to find them all on a single system (unless the admin is crazy and tried to install every package at once). If raw passwd data is confusing for you at this point in your geek evolution a one-liner can clean things up:
Group information can be handled similarly (its in nearly the same format):
Using awk to reformat some output is nice and all, but to truly let your inner geek spread his wings I'd recommend reading up a little on awk and combining the output of /etc/passwd and /etc/group to join the two together, so that you get a list of usernames joined with a list of what groups each user belongs to... And now to my question for you. You mentioned "inactive and hidden users". What did you mean by this? Like old user accounts that haven't been used in a long time or... ? This is pretty vague since none of us know your situation. You'll have to elaborate if you want further advice. |
|||||||||||
log69 |
Posted: Nov 29 2012, 07:47 AM
|
|
![]() SLF Member ![]() ![]() ![]() Group: Members Posts: 94 Member No.: 1325 Joined: 24-February 12 ![]() |
"last" command shows the most recent users logged in back to 1 month.
|
|
dp022 |
Posted: Nov 29 2012, 09:56 AM
|
|||||||||||||
SLF Newbie Group: Members Posts: 6 Member No.: 2090 Joined: 28-November 12 ![]() |
Hai,
Thanks for giving good information. But I just want to know the active users, inactive users and hidden users for the redhat linux. I know that we can see all the users in /etc/shadow file but I just want to know how to identify the users who are presently active or the users who are still using the services in the system and also to find the inactive and the hidden users. I think we can't find the hidden users from the /etc/shadow file and how to identify the inactive users(who are already create and not be useful anymore). Thanks in Advance ![]()
|
|||||||||||||
log69 |
Posted: Nov 29 2012, 11:00 AM
|
|||
![]() SLF Member ![]() ![]() ![]() Group: Members Posts: 94 Member No.: 1325 Joined: 24-February 12 ![]() |
who lsof -i |
|||
zxq9 |
Posted: Nov 29 2012, 11:01 AM
|
|
![]() SLF Geek ![]() ![]() ![]() ![]() Group: Members Posts: 321 Member No.: 611 Joined: 5-August 11 ![]() |
You need to define the terms "hidden" and "inactive" to get an answer.
"inactive" means what? Not logged in for fixnum_days? What do you mean by "hidden"? In a normal configuration there are no hidden users (and I can't think of any system at all where this is even a term), just system and non-system accounts. |
|
![]() |
![]() ![]() ![]() |