passwd change through script

Posted on 2005-04-04
Medium Priority
Last Modified: 2013-12-27

I have a requirement like this. My script should prompt for username and passwd. then through the script, i will create the user as required and also need to change the passwd.

is it possible to change the passwd through script for any user. this script will be running as root. for ex. in linux - i can use either passwd username --stdin or chpasswd. is there any such thing in solaris also??

pl. help

Question by:kusuma_hs
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
1 Comment
LVL 38

Accepted Solution

yuzh earned 600 total points
ID: 13704575
You need to use "expect" script to handle the password, you can download expect from:

once you installed expect, you can use "autoexpect" to create an expect script for change
user password.

man autoexpect
man expect
to learn more details.

You can get sample scripts from:

also have a look at my answer in the following page to get some idea how expect works:

any way autoexpect is very easy to use.

If you need more help on expect script, please post  the script question in:

    (More programming expert in that TA).



Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…
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

764 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