Computing.Net > Forums > Unix > Change password with out any prompt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Change password with out any prompt

Reply to Message Icon

Name: pnbalaji
Date: April 1, 2008 at 13:40:47 Pacific
OS: AIX 5.3
CPU/Ram: 8GB
Product: IBM, 7026-H80
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: April 1, 2008 at 14:27:03 Pacific
Reply:

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 root

set password [lindex $argv 1]
spawn /usr/bin/passwd [lindex $argv 0]
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eof

If you don't have expect on your system, download it from the expect homepage:

http://expect.nist.gov/

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.


0

Response Number 2
Name: mijenkins93
Date: April 8, 2008 at 19:12:51 Pacific
Reply:

man....8 gigs of ram is crazy!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Change password with out any prompt

Changing passwords www.computing.net/answers/unix/changing-passwords/5275.html

change password SCO www.computing.net/answers/unix/change-password-sco/4105.html

ATI All in wonder AGP and x windows www.computing.net/answers/unix/ati-all-in-wonder-agp-and-x-windows/88.html