HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Find unused logins script?
Operating System - HP-UX
1833871
Members
1792
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:17 AM
08-12-2005 03:17 AM
Find unused logins script?
Hi,
Anyone have a quick script to skim passwd and find unused logins in wtmp?
Thanks
Anyone have a quick script to skim passwd and find unused logins in wtmp?
Thanks
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:36 AM
08-12-2005 03:36 AM
Re: Find unused logins script?
cut -d: -f1 /etc/passwd | sort > allusers
will give a list of all users
last -f /var/adm/wtmp | cut -d" " -f1 | sort -u > usedusers
then
sdiff allusers usedusers
will show you the differences, and therefore which users haven't been used.
will give a list of all users
last -f /var/adm/wtmp | cut -d" " -f1 | sort -u > usedusers
then
sdiff allusers usedusers
will show you the differences, and therefore which users haven't been used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 04:03 AM
08-12-2005 04:03 AM
Re: Find unused logins script?
Here is a quickie;
cat /etc/passwd | awk -F: '{print $1}' | while read line
do
last $line
done
This will parse each line of the passwd file, do the last command against the acct name and report the results.
Note: The results will only be as good as your wtmp file. Example, if the wtmp file is recreated monthly you will only get that months data.
You can add echo commands so you can see the acct name and so forth. Modify to your needs.
cat /etc/passwd | awk -F: '{print $1}' | while read line
do
last $line
done
This will parse each line of the passwd file, do the last command against the acct name and report the results.
Note: The results will only be as good as your wtmp file. Example, if the wtmp file is recreated monthly you will only get that months data.
You can add echo commands so you can see the acct name and so forth. Modify to your needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 04:28 AM
08-12-2005 04:28 AM
Re: Find unused logins script?
Thanks simon,
I have results that I am wondering about...
rusgel <
ryaben ryaben
ryasaa | ryaobr
sadema sadema
rusgel
is unused I think
ryassa | ryaobr
Have me stumped
ryaben and sadema are loging in, right?
then there is this next thing
What or how did I get a right colum entry?
I left the line before and after for context.
jenpar jenpar
> jensch
jenste jenste
I have results that I am wondering about...
rusgel <
ryaben ryaben
ryasaa | ryaobr
sadema sadema
rusgel
is unused I think
ryassa | ryaobr
Have me stumped
ryaben and sadema are loging in, right?
then there is this next thing
What or how did I get a right colum entry?
I left the line before and after for context.
jenpar jenpar
> jensch
jenste jenste
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP