Solved

Script that checks login time

Posted on 1998-02-19
6
245 Views
Last Modified: 2013-12-23
I need help finishing a script that checks login time.  I am running AIX.  I think I can add it to the "auth_method" entry in the /etc/security/login.cfg.  The part I have written follows.  Any help would be appriciated.


****************************************************************
/usr/bin/check_login_time
****************************************************************
#!/bin/ksh      * or other shell

USER=$1
If [USER eq "root"]
  exit 0
fi

if [USER eq "eod"]
  exit 0
fi

if [ ** check the time ** -lt 4:00]
  if [** check the time ** -gt 22:59]
    echo "You may not login between 11:00 PM and 4:00 AM due to End of Day Processing.  Please try again later..."
    exit 1
  fi
fi
exit 0

**************************************************************

Thanks for your help,
Rob
0
Comment
Question by:unitymtg
  • 3
  • 3
6 Comments
 
LVL 84

Expert Comment

by:ozo
Comment Utility
if [ `date +%H` -lt 4 ] || [ `date +%H` -ge 23 ] ;then
  echo "You may not login between 11:00 PM and 4:00 AM due to End of Day Processing. Please try again later..."
fi

0
 

Author Comment

by:unitymtg
Comment Utility
I will try to put this in place tonight.  If you will submit an answer, I will give you the points if it works.

Thanks,
Rob
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
So did it work for you?  If not, what problems did you have?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:unitymtg
Comment Utility
Made a couple of mods to make it more flexible, but the formatting did the trick.  Thanks for the help.

Rob
0
 
LVL 84

Accepted Solution

by:
ozo earned 100 total points
Comment Utility
I take it you're happy with the answer then?
0
 

Author Comment

by:unitymtg
Comment Utility
Thank you very much for the help.

Rob
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Let’s list some of the technologies that enable smooth teleworking. 
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

9 Experts available now in Live!

Get 1:1 Help Now