El Módulo Net::SSH::Expect

Véase Net::SSH::Expect:

casiano@beowulf:~$ pp2@nereida:~/src/testing$ cat -n netsshexpect.pl
 1  #!/usr/bin/perl -w
 2  use strict;
 3  use Net::SSH::Expect;
 4
 5  my $host="xxxxxxx";
 6  my $password="XXXXXXXXXXXXXX";
 7  my $user="XXXXX";
 8
 9  my $ssh= Net::SSH::Expect->new( host => $host,
10                                  password=> $password,
11                                  user => $user,
12                                  raw_pty =>1);
13  $ssh->login();
14
15  my $who = $ssh->exec("who");
16  print ($who);
17
18  $ssh->close();

Ejecución

pp2@nereida:~/src/testing$ netsshexpect.pl
casiano  pts/0        2008-04-08 16:40 (nereida)
casiano  pts/1        2008-04-08 15:31 (nereida)
casiano  pts/2        2008-04-08 17:52 (nereida)
casiano  pts/3        2008-04-08 17:55 (nereida)



Subsecciones
Casiano Rodríguez León
Licencia de Creative Commons
Programación Distribuida y Mejora del Rendimiento
por Casiano Rodríguez León is licensed under a Creative Commons Reconocimiento 3.0 Unported License.

Permissions beyond the scope of this license may be available at http://campusvirtual.ull.es/ocw/course/view.php?id=44.
2012-06-19