Solved

Making changes on all users attributes on AIX version 4

Posted on 2001-09-04
5
915 Views
Last Modified: 2013-12-06
which unix command should i use?  

chsec?  chuser?

Can anyone provide an example of a command that changes the maxage, maxexpired, maxrepeats, minage, minalpha of all the users on AIX?

thanks!!
0
Comment
Question by:way_ching
  • 2
  • 2
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
AFAIK there is no command which can change all users.
But you might use awk or perl to do it. For example to set maxage to 123:

  awk -F: 'printf "%s:%s:%s:%s:%s:%s:%s:%s:%s\n", $1,$2,$3,$4,"123",$6,$7,$8,$9}' /etc/shadow
0
 

Author Comment

by:way_ching
Comment Utility
could you explain how the above awk line is constructed?
and I don't see /etc/shadow/  on the AIX system I am running...
0
 

Author Comment

by:way_ching
Comment Utility
I thought that the command chsec could change the default setting which are shared by all users.

For example, by the manual of chsec

To allow logins from 8:00 a.m. until 5:00 p.m. for all users, enter:

chsec -f /etc/security/user -s default -alogintimes=:0900-1700
0
 
LVL 6

Accepted Solution

by:
bira earned 200 total points
Comment Utility
Hi
  This script will change all your common users. ( not system default users as
root,lpd and daemon ).
Modify the parameters as you wish, save the script and run it.


for i in `lsuser ALL|cut -f1 -d' ' |grep -vE "root|lpd|daemon"`
do
echo "Changing User:" $i
chuser minage=0 $i
chuser maxage=0 $i
chuser maxexpired=0 $i
chuser maxrepeats=8 $i
chuser minalpha=0  $i
done
echo "End Of Changes"


If there are other users you want not to be modified, just include it in the
grep -vE parameter.
If you want all user to be modified, including system default users, just
change the script by removing the |grep -vE

    Regards
~
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
soryy, have no AIX available ..
do you have
  /etc/default/passwd
or
  /etc/security/passwd

if so, you probably just need to edit this file
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 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

14 Experts available now in Live!

Get 1:1 Help Now