Friday, August 19, 2011

Linux PAM , Lock account in Linux using

Dear friend as an admin every day my boss gives a list of different users for login denied

so i use :->

root#passwd -l user1

for that users for locking &

root#passwd -u user1

for unlocking them

but i have 100 users lists every day

so it makes me busy for 1 hr every day

suddenly i remember about file /etc/vsftpd/ftpuser

then for the help of pam.d i applied it to login attempt

I just write in top of the file

root# vi /etc/pam.d/login

auth required item=user sens=deny file=/etc/logindeny onerr=succeed


& then i create a file & write the name of user which would be denied for that day

root# vi /etc/logindeny





& now every day i have to edit only that file & my users are denied for the day

It saves my time daily.