Operating System - HP-UX
1827459 Members
4063 Online
109965 Solutions
New Discussion

Re: User account duration

 
SOLVED
Go to solution
Rgomes
Valued Contributor

User account duration

Hi All,

How can I implement user account expiration in 11i. Say I want user1 can access my system for 1yr, how can do it? I tried with -e option of useradd command, but it gave me a message like " need security package". What is this?
Can I do it from SAM?

Thanks in advance,
Best regards

Richard
3 REPLIES 3
Steven E. Protter
Exalted Contributor
Solution

Re: User account duration

My first response in this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x01daccdc59251044b58958073b870a6f,00.html

contains a script as an attachment that was based on just what you need to do.

Here you go.


#!/sbin/sh

MINDAYS=7
MAXDAYS=61

for user in `awk '{ FS=":"; print $1 $5 $6 }' /root/passwd`
do
passwd -r file -n $MINDAYS -x $MAXDAYS $user
echo "Command: useradd -m $user "
done


set MAXDAYS to whatever you need.
This guy reads a copy of /etc/passwd but you can change that.

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
Con O'Kelly
Honored Contributor

Re: User account duration

Hi Richard

Look at the passwd command, eg:
# passwd -n 7 -x 90 -w 7
See man passwd.

You can set System defaults in SAM:
Auditing & Security -> System Security Policies -> Password Aging Policies.

This will set defaults for all users created.
However I believe your system needs to be trusted to do this. With non trusted systems you can only do it on a user by user basis with the above command.

Cheers
Con



Keith Bevan_1
Trusted Contributor

Re: User account duration

Richard,

Yes, is the answer if a non-trusted system and only on a users by user basis (and you can set it by number of weeks ie 52 for one year !)

If on a trusted system follow the details that Con O'Kelly provided previous.

Keith

You are either part of the solution or part of the problem