This is a discussion on Change root password using perl script? within the Solaris/OpenSolaris forums, part of the UNIX operating systems category; I would like to change password using perl script... any idea how to do it? -Raj...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| Sponsored Links | ||
|
|
|
||||
|
You really don't need a perl script. All you need is following shell script and expect tool:
Code:
vi npasswd Code:
#!/bin/sh
# \
exec expect -f "$0" ${1+"$@"}
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "assword:"
send "$password\r"
expect "assword:"
send "$password\r"
expect eof
Code:
npasswd vivek 123456 npasswd : script name vivek : username 123456: Newpassword Script must be run as a root user, it can be call from perl, php or any other lanauge. Download expect tool here: http://expect.nist.gov/ |
|
|||
|
Hi i download expect and Tcl and store it in the path /usr/local/src.
But while run ./configure file, it was unable to detect the Tcl file.. How to install the expect..? |
|
|||
|
Quote:
Hi Monk, Can you pls tell me how to run this script. I am completely nuts abt perl. THanks, VIKAS |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to change root password | sandromax | Solaris/OpenSolaris | 4 | 10-11-2007 02:43 AM |
| let users change password using perl script? | james bond | Getting started tutorials | 9 | 05-24-2007 10:32 PM |
| Change root password MySQL 5 | chiku | Databases servers | 1 | 01-16-2007 08:46 PM |
| HP UX user lock password, change password, password aging | rockdalinux | HP-UX | 0 | 12-20-2006 02:36 PM |
| How to Change Password | puppen | Linux software | 6 | 06-06-2006 01:56 PM |