How to list Linux non-system local users

13 July,2018 by Tom Collins

Question: I'd like to capture Linux local users who are not system users and also return the server name and group associated with the local user. What statement can I execute to create this list ?

 

 Answer: Linux offers a number of different methods to report on local users and other meta data associated with the user such as groups and permissions .

This code snippet will return non-system users and exclude "user1" and "user2". I've added that predicate to give you some flexibility around how you construct the code.

Based on the details  - the hostname and the group of the user is returned

Run the code through cmdline 

  Linux_local_users

Read more on Linux

3 signs of low Linux memory (DBA DB2)

Powershell grep and awk (DBA DB2)

Author: Rambler(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to list Linux non-system local users

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright