Solved

Making changes on all users attributes on AIX version 4

Posted on 2001-09-04
5
945 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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.
Suggested Courses

737 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