in reply to Net::SSH::Expect problem
#!/usr/bin/perl use strict; use warnings; use Net::SSH::Expect; my $host = '127.0.0.1'; my $pass = 'password'; my $user = 'user'; my $cmd = "ls -l /"; my $ssh = Net::SSH::Expect->new( host => $host, password => $pass, user => $user, timeout => 5, raw_pty => 1, log_stdout => 1, ); $ssh->login(); $ssh->exec("$cmd ."); $ssh->close;
|
|---|