Solved

Making changes on all users attributes on AIX version 4

Posted on 2001-09-04
5
952 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6456017
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
ID: 6456083
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
ID: 6456138
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
ID: 6457626
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
ID: 6458875
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

726 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