LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-24-2009, 04:19 AM   #1
pgkv
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
want to lock user account if he is not logged in


Dear All
I am running a mail server with combination of dovecot,sendmail and squirremail as web client. I want to change the password of the user if he/she not logged in for 21 days.Please help in this regard
 
Old 11-24-2009, 04:37 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,369

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Would you by any chance be looking after msn or hotmail? It sounds like a M$ thing to do.
Are you logging logins? Write a script, list your users, and grep for them each in the last 21 days of logs
use head, tail, or cut to get the last 21 days worth
 
Old 11-24-2009, 05:04 AM   #3
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Suggest: use lastlog -t 21 to get list of users which last logged in more recent than 21 days. And after that, you can exclude them from actual users list (example: cat /etc/passwd | awk -F: '$3 > 500' | cut -d: -f1)

Or you can use lastlog with -u option.
 
Old 11-24-2009, 11:21 PM   #4
pgkv
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by quanta View Post
Suggest: use lastlog -t 21 to get list of users which last logged in more recent than 21 days. And after that, you can exclude them from actual users list (example: cat /etc/passwd | awk -F: '$3 > 500' | cut -d: -f1)

Or you can use lastlog with -u option.
The users are restricted to FTP and TELNET.They logged only through web mail client. So how can i use lastlog.
 
Old 11-25-2009, 01:14 AM   #5
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by pgkv View Post
The users are restricted to FTP and TELNET.They logged only through web mail client. So how can i use lastlog.
Sorry, I misunderstood your first post.

I am not familiar with Squirrelmail but I think you can try some of the plugins:
http://squirrelmail.org/plugin_view.php?id=123
http://squirrelmail.org/plugin_view.php?id=117
http://squirrelmail.org/plugin_view.php?id=25
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lock user account after failed login attempts with FC 10 hv905c Linux - Security 1 05-18-2009 08:44 PM
Can I permanently lock a user account with pam_tally ? dmak168 Linux - Security 2 09-04-2008 02:40 PM
how can i as the root know what is the last account logged in this computer Muhammed Linux - Software 3 08-17-2007 07:33 AM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
mozilla works fine when logged in as a user but crashes when logged in as root jimi Linux - General 6 04-02-2003 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration