Advertisement

06.01.2008 at 11:59PM PDT, ID: 23449058
[x]
Attachment Details

getting days to expiry for passwords where /etc/shadow does not exist

Asked by sunhux in Unix Network Security, Linux

Tags: , , ,

Hi,

Currently I use the following script to obtain the number of days root password
is expiring.  However this script will not work if /etc/shadow do not exist, esp
in an enhanced security mode (where /etc/shadow is not used).

Kindly suggest alternative or how I can work around this - if you can amend
my script's codes, that will be great.  I'm using HP-UX B.11.23 U ia64

## Today's date (expressed in epoch format)
  today=`perl -e 'printf("%d\n", (time/60/60/24))'`

  line=`grep root: /etc/shadow`
  USER=root
  DAY_LAST_PASS_CHANGE=`echo $line | awk -F: '{print $3}'`
  DAYS_PASS_VALID=`echo $line | awk -F: '{print $5}'`
  DAYS_SINCE_LAST_PASS_CHANGE=`expr $today - $DAY_LAST_PASS_CHANGE`
  DAYS_UNTIL_PASS_EXPIRE=`expr $DAYS_PASS_VALID - $DAYS_SINCE_LAST_PASS_CHANGE`

  echo "Root password expiring in "$DAYS_UNTIL_PASS_EXPIRE" days"
Start Free Trial
 
Loading Advertisement...
 
[+][-]06.02.2008 at 02:48AM PDT, ID: 21690653

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.02.2008 at 02:48AM PDT, ID: 21690655

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.02.2008 at 03:48AM PDT, ID: 21690864

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.02.2008 at 12:40PM PDT, ID: 21694960

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.04.2008 at 02:02AM PDT, ID: 21708099

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 06:39AM PDT, ID: 21709938

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Unix Network Security, Linux
Tags: HP, HP-UX, B.11.23 U ia64, password expiry date
Sign Up Now!
Solution Provided By: duncan_roe
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.04.2008 at 07:00PM PDT, ID: 21715887

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 07:14PM PDT, ID: 21715930

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.05.2008 at 04:39AM PDT, ID: 21718157

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.05.2008 at 09:29PM PDT, ID: 21726225

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 09:38PM PDT, ID: 21726252

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 12:22AM PDT, ID: 21726882

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.06.2008 at 03:30AM PDT, ID: 21727663

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.10.2008 at 03:20AM PDT, ID: 21749766

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 04:08AM PDT, ID: 21750002

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.10.2008 at 06:58PM PDT, ID: 21756310

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 05:14AM PDT, ID: 21759130

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.11.2008 at 06:11AM PDT, ID: 21759634

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.13.2008 at 12:25AM PDT, ID: 21776606

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2008 at 03:22AM PDT, ID: 21777401

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.16.2008 at 11:14PM PDT, ID: 21800223

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 03:18AM PDT, ID: 21801412

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.17.2008 at 03:35AM PDT, ID: 21801521

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 03:36AM PDT, ID: 21801526

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 07:02AM PDT, ID: 21803109

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.30.2008 at 01:07AM PDT, ID: 21897418

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:08AM PDT, ID: 21897421

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 01:13AM PDT, ID: 21897435

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628