Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am not a root user, but I am part of the security group in our AIX box who has the authority to create new AIX users. Now, we upgraded our server and I need to nearly 50 new users in the system. However, using the pwdadm command or passwd command prompts for the new password twice. I want to create the users using a batch process and I want to set the passwords to 'setnew1' for all new users.I don't want any prompts or confirmation when creating the users.
Is there a way to acheive this? Can some one help?
Thanks,
Balaji.

First, only someone with root permissions can change passwords (sudo maybe used to grant certain permissions to non-root users)a common method for automating the pwadmin prompts is to use expect.
The following is an expect script which automates pwadin. It is a variation of a script bundled with expect:
#!/usr/local/bin/expect --
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd
# Executable only by rootset password [lindex $argv 1]
spawn /usr/bin/passwd [lindex $argv 0]
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eofIf you don't have expect on your system, download it from the expect homepage:
Second, I'm not an AIX person, but you can automate creating users from the command line with the useradd command - at least under solaris.
If AIX doesn't have useradd, try adduser.
Finally, check out this article:
http://www.unixreview.com/documents...
It creates a script to automate creating user accounts with useradd. It's solaris specific, but it might give you some ideas.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |