- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Find inactive users
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
05-07-2002 06:58 AM
05-07-2002 06:58 AM
I am tying to find inactive users or the users never login, I think finger command or -mtime can help, so I can remove those inactive users...Is anyone have a script to get this done.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 07:03 AM
05-07-2002 07:03 AM
SolutionA couple of tricks help. You can use 'find' to traverse the $HOME directories of the users looking at the last access date for their '.profile' [assuming their default shell is the Posix or ksh shell] and collect a list for culling.
You can examine the /var/adm/wtmp file (if you keep it) using 'last' and compare its contents to /etc/passwd in a fashion which returns a list of users who do *not* appear in 'wtmp'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 07:07 AM
05-07-2002 07:07 AM
Re: Find inactive users
Convert your system to trusted, and set passwd expire and inactivity.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 07:08 AM
05-07-2002 07:08 AM
Re: Find inactive users
You can use who to find old logins.
#who -a |grep old
then run ps -e to find out that pid if you can means that login is old you can remove it.
for example
#who -a |grep old
sachin ttyp1 Jan 8 09:47 old 8071 10.20.46.71:0.0
#ps -e |grep 8071
8071 ttyp1 0:00 csh
means that login is been inactive for logtime and it is been old.
#kill 8071
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 07:10 AM
05-07-2002 07:10 AM
Re: Find inactive users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 07:14 AM
05-07-2002 07:14 AM
Re: Find inactive users
Do you know the command "last"?
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2002 07:25 AM
05-07-2002 07:25 AM
Re: Find inactive users
first, get list of users on the box:
cat /etc/passwd | awk '{FS=":";print $1}' >/tmp/list_users
Next, run last command and see when they logged in last on the system, somthing like:
while read -r name
do
last $name | head -1 >>/tmp/user_activity
done
Then, decide on what sort of cut of date you are using for inactivity. If it is for users not logged in this year, do a simple:
grep "2001" /tmp/list_users > inactive_users
BAsed on what you are looking for, you can use greap search pattern accordingly.
Finally to remove those users run
userdel on the list of inactive users.
HTH
raj