Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2366
  • Last Modified:

passwd change through script

hi,

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

Regards,
Kusuma
0
kusuma_hs
Asked:
kusuma_hs
1 Solution
 
yuzhCommented:
You need to use "expect" script to handle the password, you can download expect from:
     http://sunfreeware.com/

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:
    http://expect.nist.gov/

also have a look at my answer in the following page to get some idea how expect works:
    http:Q_20419559.html
    http:Q_21277651.html

any way autoexpect is very easy to use.

If you need more help on expect script, please post  the script question in:
    http://www.experts-exchange.com/Programming/Programming_Platforms/Unix_Programming/

    (More programming expert in that TA).

Cheers!

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now