Solved

How do I disable a Red Hat user account that has been inactive for 'x' days?

Posted on 2009-07-08
3
1,251 Views
Last Modified: 2016-06-15
How do I disable a Red Hat (Enterprise Linux 5.3) user account that has been inactive for 'x' days?

I want user accounts that haven't logged into the system after a certain amount of time to be locked.
0
Comment
Question by:TogaMario
3 Comments
 
LVL 29

Accepted Solution

by:
fosiul01 earned 125 total points
ID: 24804465
lastlog will show you the last activity of user

you can use

lastlog -u username

but if you want to make it automatic then you will have to use a script to do this
0
 

Author Closing Comment

by:TogaMario
ID: 31601119
That was exactly what I needed to know, thank you. I've setup a cron job that runs every day at midnight - it marches through the /etc/passwd file, pulls out the usernames, checks them against activity in lastlog and uses the "passwd" command appopriately to disable wayward accounts.
0
 

Expert Comment

by:pctechsupport
ID: 41655376
Late, I know, but you can use pam_lastlog to do this without having to use scripts and cron.
 To lock out an account after 10 days of inactivity, add, as root, the following line to the auth section of the /etc/pam.d/login file:

auth  required  pam_lastlog.so inactive=10
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order for businesses to be compliant with certain information security laws in some countries, you need to be able to prove that a user (which user it was becomes important to the business to take action against the user after an event has occurr…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now