Solved

Making changes on all users attributes on AIX version 4

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

809 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