Hi All,
First thanks for reading this !
I'm currently trying to implement sftp support on by perl backup
program, simplebackup (
http://migas.kicks-ass.org/index.php?pag=en.myapps&subpag=simplebackup
)
But i'm getting stuck, the program manages to connect but it never
(aparently) to login, no mather what code i try to use, plus i'm
unable to control the login process... the program just dies i can't
get it control with eval or any other thing.
Here is a example:
eval {
require Net::SFTP; #attempt to detect if the sftp modulo is installed
};
if ($@) {
print "Error Net::SFTP module is not installed\n";
}
my %ssh_args = (
port => "443",
debug => "1",
);
my %sftp_args = (
user => "some_user",
password => "some_password",
debug => "1",
ssh_args=>\%ssh_args,
);
eval {
$ftp_sftp_connection_p = Net::SFTP->new( "some_server", %sftp_args);
}
if ($@) {
# THIS CODE NEVER WORKS... the script DIES
print "Failed loginn";
}
#
# Here is the debug
#
migas: Reading configuration data /root/.ssh/config
migas: Reading configuration data /etc/ssh_config
migas: Allocated local port 1023.
migas: Connecting to localhost, port 443.
migas: Remote version string: SSH-1.99-OpenSSH_3.9p1
migas: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
migas: Net::SSH::Perl Version 1.30, protocol version 2.0.
migas: No compat match: OpenSSH_3.9p1.
migas: Connection established.
migas: Sent key-exchange init (KEXINIT), wait response.
migas: Algorithms, c->s: 3des-cbc hmac-sha1 none
migas: Algorithms, s->c: 3des-cbc hmac-sha1 none
migas: Entering Diffie-Hellman Group 1 key exchange.
migas: Sent DH public key, waiting for reply.
migas: Received host key, type 'ssh-dss'.
migas: Host 'localhost' is known and matches the host key.
migas: Computing shared secret key.
migas: Verifying server signature.
migas: Waiting for NEWKEYS message.
migas: Enabling incoming encryption/MAC/compression.
migas: Send NEWKEYS, enable outgoing encryption/MAC/compression.
migas: Sending request for user-authentication service.
migas:~ #
# There we return to the prompt... the script died
# Here is the syslog message from the ssh server
Sep 13 10:39:48 migas sshd[29484]: fatal: Timeout before
authentication for::ffff:127.0.0.1
I also notice that the comunication process with the ssh server is
very slow (minutes), can this be the problem ??
Can anyone give me any help... PLEASE , i have looked and look the net
and several foruns to no avail.
Stay Happy !
Miguel Angelo - Migas
http://migas.kicks-ass.org
ICQ: 40421832
Msn: mig...@gm...
Google Talk: mig...@gm...
|