sorry but i know nothing about Net::SSH, hope this is somewhat helpfulsub start_login { open(STDERR, ">&STDOUT"); my $telnet; my $PASSWD = "/bin/passwd"; telnet_login($username,$password,$host,\$telnet); #custom login fu +nction $telnet->print('passwd'); $telnet->waitfor('/password:/i') or report_error("ERROR","No passw +ord prompt found");; $telnet->print($password); my($pre,$match) = $telnet->waitfor(Match => '/Incorrect password/' +, Match => '/New password:/'); $match =~ /New/ or report_error("ERROR","Not prompted for new pass +word");; $telnet->print($new_password); ($pre,$match) = $telnet->waitfor(Match => '/Bad password/', Match => '/Re-enter new password:/ +'); $match =~ /Re-enter/ or report_error("ERROR","New password rejecte +d"); $telnet->print($new_password); $telnet->waitfor('/changed/i') or report_error("ERROR","New passwo +rd rejected"); telnet_close(\$telnet); #gentially close this object, it has been +nice to us we hope $success = 1; }
In reply to Re: Password change (Newbie)
by jcpunk
in thread Password change (Newbie)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |