Operating System - HP-UX
1748202 Members
3053 Online
108759 Solutions
New Discussion

Re: Need to get password Attributes

 

Re: Need to get password Attributes

Dan,

>> phd=` grep ^PASSWORD_HISTORY_DEPTH /etc/default/security ...

Fine, except there is no actual requirement for the keyword to appear in column 1 , or even for a comment line to have a "#" in column 1 of the file, so there could be some white space in there... maybe:

phd=$( grep "^[[:space:]]*PASSWORD_HISTORY_DEPTH=" /etc/default/security | sed -e 's/.*=//' )

All goes to show there are many ways to do this, and each way requires you to think carefully about the input...

HTH

Duncan

I am an HPE Employee
Accept or Kudo
vishnu.khandare
Respected Contributor

Re: Need to get password Attributes

Hi Vidhya B,

for ur query i guess u want to write a script to get the said parmeters.

R u ware of the command "logins -aox"

Please check its man page even this command give the output of all the users with, last passwd reset, PASSWORD_MAXDAYS
PASSWORD_MINDAYS
PASSWORD_WARNDAYS

and many more check its man page for more details.

Hope this solves ur query.

Thanks & Regards
Vishnu Khandare
You should deserve before U desire!!!!