View Single Post

  #3 (permalink)  
Old 05-24-2007, 07:08 AM
james bond james bond is offline
Junior Member
User
 
Join Date: May 2007
My distro: Debian
Posts: 7
Rep Power: 0
james bond is on a distinguished road
Default

Hi, thanks for your quick response.

Here is my php code which is exactly same as in the link I posted. I just changed this one line with my shell script name
Code:
<?php

$shellscript = “/usr/bin/sudo autopasswd”;
.....
.......
// display footer 
function writeFoot(){
echo 



;
}
?>
Also added the line using "visudo" command
Code:
www-data  ALL=NOPASSWD: /var/www/html/autopasswd
And here is my shell script of "autopasswd"
Code:
#!/usr/bin/expect -f

set password [lindex $argv 1]
spawn password [lindex $argv 0]
expect "assword:"
send --"$password\r"

expect "assword:"
send --"$password\r"
expect eof
this script works when i run it as
Code:
 ./autopasswd username password
But when run the php script it shows nothing. Any help will be greatly appreciated.
I want to give a web interface to users to change their password.
thanks in advance.
Reply With Quote