Using perl Syntax Highlighting
Pero no logro hacer que funcione y en teoría es muy simple.
Using perl Syntax Highlighting
#!/usr/bin/perl
use Net::SFTP::Foreign;
use Net::SSH::Expect;
##################################
# You can do SSH authentication with user-password or without it.
# Making an ssh connection with user-password authentication
# 1) construct the object
my $ssh = Net::SSH::Expect->new (
host => "XXX.XXX.XXX",
password=> 'elpasword',
user => 'apolo',
raw_pty => 1
);
# 2) logon to the SSH server using those credentials.
# test the login output to make sure we had success
my $login_output = $ssh->login();
if ($login_output !~ /Welcome/) {
die "NO SE PUDO CONECTAR $login_output";
}
#############################
my $remote = "/usr/users/equipo/";
my $local = "/home/apolo/Desktop/";
Net::SFTP::Foreign->new($sftp->get($remote,$local,))or die "No se Puede logear ", $sftp->message."\n";
$sftp->quit;
use Net::SFTP::Foreign;
use Net::SSH::Expect;
##################################
# You can do SSH authentication with user-password or without it.
# Making an ssh connection with user-password authentication
# 1) construct the object
my $ssh = Net::SSH::Expect->new (
host => "XXX.XXX.XXX",
password=> 'elpasword',
user => 'apolo',
raw_pty => 1
);
# 2) logon to the SSH server using those credentials.
# test the login output to make sure we had success
my $login_output = $ssh->login();
if ($login_output !~ /Welcome/) {
die "NO SE PUDO CONECTAR $login_output";
}
#############################
my $remote = "/usr/users/equipo/";
my $local = "/home/apolo/Desktop/";
Net::SFTP::Foreign->new($sftp->get($remote,$local,))or die "No se Puede logear ", $sftp->message."\n";
$sftp->quit;
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4