Net::SFTP Fails, sftp OK

Discussion in 'Perl Misc' started by MaggotChild, Oct 28, 2009.

  1. MaggotChild

    MaggotChild Guest

    This just fails unexpectedly. With sftp I can connect no problem:

    perl -MNet::SFTP -le'$ftp = Net::SFTP->new("sftp.xj999.com", user =>
    "X", password => "Z", debug => 1); print $_->{filename} for $ftp->ls;'
    localhost: Reading configuration data /mounts/sysadm/xj/.ssh/config
    localhost: Reading configuration data /etc/ssh_config
    localhost: Connecting to sftp.xj999.com, port 22.
    localhost: Remote protocol version 2.0, remote software version
    5.1.3.8 SSH Tectia Server
    localhost: Net::SSH::perl Version 1.34, protocol version 2.0.
    localhost: No compat match: 5.1.3.8 SSH Tectia Server
    localhost: Connection established.
    localhost: Sent key-exchange init (KEXINIT), wait response.
    localhost: Algorithms, c->s: 3des-cbc hmac-sha1 none
    localhost: Algorithms, s->c: 3des-cbc hmac-sha1 none
    localhost: Entering Diffie-Hellman Group 1 key exchange.
    Broken Pipe


    I had some trouble installing Net::SFTP, so I figured maybe it was
    the install but, on another machine:

    localhost: Reading configuration data /home/xj/.ssh/config
    localhost: Reading configuration data /etc/ssh_config
    localhost: Connecting to sftp.xj999.com, port 22.
    localhost: Remote version string: SSH-2.0-5.1.3.8 SSH Tectia Server

    localhost: Remote protocol version 2.0, remote software version
    5.1.3.8 SSH Tectia Server
    localhost: Net::SSH::perl Version 1.30, protocol version 2.0.
    ..ocalhost: No compat match: 5.1.3.8 SSH Tectia Server
    localhost: Connection established.
    localhost: Sent key-exchange init (KEXINIT), wait response.
    Connection closed by remote host. at /usr/lib/perl5/site_perl/5.8.8/
    Net/SSH/Perl/Kex.pm line 142

    These are both v0.10

    Also, what's up with the SFTP docs -they suck! Does new() die? How do
    I cd, can I cd? How do I close the connection?

    Thanks
    MaggotChild, Oct 28, 2009
    #1
    1. Advertising

  2. MaggotChild

    MaggotChild Guest

    On Oct 28, 8:46 am, MaggotChild <> wrote:
    > This just fails unexpectedly. With sftp I can connect no problem:
    >
    >  perl -MNet::SFTP -le'$ftp = Net::SFTP->new("sftp.xj999.com", user =>
    > "X", password => "Z", debug => 1); print $_->{filename} for $ftp->ls;'
    > localhost: Reading configuration data /mounts/sysadm/xj/.ssh/config
    > localhost: Reading configuration data /etc/ssh_config
    > localhost: Connecting to sftp.xj999.com, port 22.
    > localhost: Remote protocol version 2.0, remote software version
    > 5.1.3.8 SSH Tectia Server
    > localhost: Net::SSH::perl Version 1.34, protocol version 2.0.
    > localhost: No compat match: 5.1.3.8 SSH Tectia Server
    > localhost: Connection established.
    > localhost: Sent key-exchange init (KEXINIT), wait response.
    > localhost: Algorithms, c->s: 3des-cbc hmac-sha1 none
    > localhost: Algorithms, s->c: 3des-cbc hmac-sha1 none
    > localhost: Entering Diffie-Hellman Group 1 key exchange.
    > Broken Pipe


    Trying to use version SSH 1 I get:

    Can't locate object method "_session_channel" via package
    "Net::SSH::perl::SSH1" at /usr/lib/perl5/site_perl/5.8.8/Net/SFTP.pm
    line 78.

    maybe *both* my installs are screwed up.
    MaggotChild, Oct 28, 2009
    #2
    1. Advertising

  3. MaggotChild

    C.DeRykus Guest

    On Oct 28, 9:46 am, MaggotChild <> wrote:
    > This just fails unexpectedly. With sftp I can connect no problem:
    >
    >  perl -MNet::SFTP -le'$ftp = Net::SFTP->new("sftp.xj999.com", user =>
    > "X", password => "Z", debug => 1); print $_->{filename} for $ftp->ls;'
    > localhost: Reading configuration data /mounts/sysadm/xj/.ssh/config
    > localhost: Reading configuration data /etc/ssh_config
    > localhost: Connecting to sftp.xj999.com, port 22.
    > localhost: Remote protocol version 2.0, remote software version
    > 5.1.3.8 SSH Tectia Server
    > localhost: Net::SSH::perl Version 1.34, protocol version 2.0.
    > localhost: No compat match: 5.1.3.8 SSH Tectia Server
    > localhost: Connection established.
    > localhost: Sent key-exchange init (KEXINIT), wait response.
    > localhost: Algorithms, c->s: 3des-cbc hmac-sha1 none
    > localhost: Algorithms, s->c: 3des-cbc hmac-sha1 none
    > localhost: Entering Diffie-Hellman Group 1 key exchange.
    > Broken Pipe
    >
    > I had some trouble installing Net::SFTP, so I figured  maybe it was
    > the install but, on another machine:
    >
    > localhost: Reading configuration data /home/xj/.ssh/config
    > localhost: Reading configuration data /etc/ssh_config
    > localhost: Connecting to sftp.xj999.com, port 22.
    > localhost: Remote version string: SSH-2.0-5.1.3.8 SSH Tectia Server
    >
    > localhost: Remote protocol version 2.0, remote software version
    > 5.1.3.8 SSH Tectia Server
    > localhost: Net::SSH::perl Version 1.30, protocol version 2.0.
    > .ocalhost: No compat match: 5.1.3.8 SSH Tectia Server
    > localhost: Connection established.
    > localhost: Sent key-exchange init (KEXINIT), wait response.
    > Connection closed by remote host. at /usr/lib/perl5/site_perl/5.8.8/
    > Net/SSH/Perl/Kex.pm line 142
    >
    > These are both v0.10


    Sorry don't know but a quick Google filtered lookup
    using the exact phrase:

    Can't locate object method "_session_channel"

    has a thread about possible Win32 install related
    problems that might be helpful.

    >
    > Also, what's up with the SFTP docs -they suck! Does new() die?

    How do
    > I cd, can I cd? How do I close the connection?
    >


    Sounds like you may need to eval wrap new() to catch fatalities..
    There're examples in the /eg distro directory and a mailing list for
    usage questions. See SUPPORT in the docs. Also I see SFTP only
    implements a subset of SSH FTP protocol commands. This is mentioned
    in the docs as well. (Alternatively, Net::SCP does provide a 'cwd')

    --
    Charles DeRykus
    C.DeRykus, Oct 29, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders
    Replies:
    1
    Views:
    657
    John Saunders
    Nov 18, 2003
  2. Jamis Buck
    Replies:
    0
    Views:
    95
    Jamis Buck
    Jun 18, 2005
  3. Replies:
    2
    Views:
    282
    Grant Wagner
    Dec 23, 2004
  4. okey
    Replies:
    1
    Views:
    151
    Jim Gibson
    Apr 3, 2009
  5. Kevin13
    Replies:
    3
    Views:
    902
    Kevin13
    Dec 1, 2009
Loading...

Share This Page