Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Making changes on all users attributes on AIX version 4

Posted on 2001-09-04
5
Medium Priority
?
970 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
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 800 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.
Suggested Courses

971 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