Operating System - HP-UX
1833003 Members
2002 Online
110048 Solutions
New Discussion

Re: setting password non expiry by command line on a untrusted system

 
HejALL
Occasional Contributor

setting password non expiry by command line on a untrusted system

I have some 30 users whose password has to be set non expiry for 90 HPUX boxes. I dont find any solution to so it in command line so that I can use that on script. Can anyone help me on this?
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: setting password non expiry by command line on a untrusted system

shalom,

cat /etc/passwd | awk -F: '{print $1}' > userlist

edit the user list to include only the 30 that need a change.

while read -r un
do

done < userlist

This is not something HP wants you to be able to easily do, so you might be better off doing it manually with sam.

Side Note: Doing this will insure you fail your next security audit. Having user passwords expire is a basic point for system security. If you are subject to US SOX laws this action violates them as well.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Prashanth Waugh
Esteemed Contributor

Re: setting password non expiry by command line on a untrusted system

Hi,

use
#modprpw expwarn=0

check the manapges for modprpw . u will get all answer.

Regards
Aul
For success, attitude is equally as important as ability
Prashanth Waugh
Esteemed Contributor

Re: setting password non expiry by command line on a untrusted system

Hi,

Sorry i have given for trusted system

Reagrds
Atul
For success, attitude is equally as important as ability
Prashanth Waugh
Esteemed Contributor

Re: setting password non expiry by command line on a untrusted system

Hi,

R u doing it in trusted system

Regards
Atul
For success, attitude is equally as important as ability
Deepak Kr
Respected Contributor

Re: setting password non expiry by command line on a untrusted system

Hi!!

Here is the solution for Untrusted system:

cat /etc/passwd |cut -d : -f 1 > /temp/user.file
vi user.file to set required 30 users and then run

for user in `cat /temp/user.file`
do
passwd -f -n 90 $user
done

This will solve your query!!

Cheers!!

Deepak

"There is always some scope for improvement"
Tingli
Esteemed Contributor

Re: setting password non expiry by command line on a untrusted system

You can use:
/bin/passwd -x -1