rajar has asked for the wisdom of the Perl Monks concerning the following question:
Any help would be greatly appreciated.
Here is my connect method:
And here is the output:sub connect { my ($pserver,$puser,$ppass)=@_; warn "-----------------Entering connect--------------------"; #Connect and login to the server my $port = 22; my %args = (ssh_args => []); $args{user} = $puser; $args{password} = $ppass; $args{debug} = 1; $args{protocol} = '2,1'; push @{ $args{ssh_args} }, port => $port; my $pftp = Net::SFTP->new($pserver,%args) or die "Cannot conne +ct to $pserver: $@"; warn "------------------Connected--------------------"; $pftp->login($puser,$ppass) or die "Cannot login ", $pftp->me +ssage; warn "return from connect"; return $pftp; }
-----------------Entering connect-------------------- at ./checkftp li +ne 31. : Reading configuration data /home/sbiadmin/.ssh/config xxxxxxserver: Reading configuration data /etc/ssh_config xxxxxxserver: Connecting to xxx.xxx.xxx.87, port 22. xxxxxxserver: Remote protocol version 2.0, remote software version 3.1 +.2 SSH Secure Shell Windows NT Server xxxxxxserver: Net::SSH::Perl Version 1.29, protocol version 2.0. .yyyyyserver: No compat match: 3.1.2 SSH Secure Shell Windows NT Serve +r xxxxxxserver: Connection established. xxxxxxserver: Sent key-exchange init (KEXINIT), wait response. xxxxxxserver: Algorithms, c->s: 3des-cbc hmac-sha1 none xxxxxxserver: Algorithms, s->c: 3des-cbc hmac-sha1 none xxxxxxserver: Entering Diffie-Hellman Group 1 key exchange. xxxxxxserver: Sent DH public key, waiting for reply. xxxxxxserver: Received host key, type 'ssh-dss'. xxxxxxserver: Host 'xxx.xxx.xxx.87' is known and matches the host key. xxxxxxserver: Computing shared secret key. xxxxxxserver: Verifying server signature. xxxxxxserver: Waiting for NEWKEYS message. xxxxxxserver: Enabling incoming encryption/MAC/compression. xxxxxxserver: Send NEWKEYS, enable outgoing encryption/MAC/compression +. xxxxxxserver: Sending request for user-authentication service. xxxxxxserver: Service accepted: ssh-userauth. xxxxxxserver: Trying empty user-authentication request. xxxxxxserver: Authentication methods that can continue: publickey,pass +word. xxxxxxserver: Next method to try is publickey. xxxxxxserver: Next method to try is password. xxxxxxserver: Trying password authentication. xxxxxxserver: Authentication methods that can continue: publickey,pass +word. xxxxxxserver: Next method to try is publickey. xxxxxxserver: Next method to try is password. xxxxxxserver: Trying password authentication. xxxxxxserver: Authentication methods that can continue: publickey,pass +word. xxxxxxserver: Next method to try is publickey. xxxxxxserver: Next method to try is password. xxxxxxserver: Trying password authentication. xxxxxxserver: Authentication methods that can continue: publickey. xxxxxxserver: Next method to try is publickey. Permission denied at /usr/local/share/perl/5.8.7/Net/SFTP.pm line 62
2006-01-30 Retitled by Arunbear, as per Monastery guidelines
Original title: 'Net::SFTP'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: log into FTP server using Net::SFTP
by explorer (Chaplain) on Jan 30, 2006 at 20:34 UTC | |
by rajar (Initiate) on Jan 30, 2006 at 21:18 UTC | |
|
Re: log into FTP server using Net::SFTP
by zentara (Cardinal) on Jan 30, 2006 at 20:46 UTC |