- or download this
#!/usr/bin/perl
...
#$ssh->send("") or die "Cannot spawn: $!\n";
$ssh->close();
- or download this
Cannot execute the passwd command
- or download this
#!/usr/bin/perl
...
die "Login has failed. Login output was $login_output";
}
print "Connected to $uName\n";
- or download this
my $who = $ssh->exec("who");
print ($who);
- or download this
$ssh->send("passwd");
$ssh->waitfor("Changing password for $uName.\n(current) UNIX password:
+ ", 2) or die "prompt 'password' not found after 2 second";
...
$ssh->send("qwerty123");
$ssh->close();
- or download this
admin3@admin3-VirtualBox:~/Desktop$ perl NetSSHExpect.pl
Connected to admin1
...
admin1 pts/1 2019-07-19 12:41 (192.168.56.1)
admin1@admin1-VirtualBox:~$ prompt 'password' not found after 2 second
+ at NetSSHExpect.pl line 36.
admin3@admin3-VirtualBox:~/Desktop$