catalyst at mikeraynham
May 27, 2011, 3:15 AM
Post #3 of 3
Sorry to dig up an old thread, but I have been trying to get SFTP
working with Bricolage, and encountered a few problems, which turned out
to be related to Net::SSH2 and libssh2.
SFTP worked correctly when using a non-password protected SSH key, but
it failed when I created a password protected key. It eventually boiled
down to a problem with the libssh2-1-dev package on my Ubuntu
installation. It was using libssh2 version 1.2.2. When I installed
libssh2 from source (version 1.2.8), the password protected key worked.
However, this meant that I had both the Ubuntu package installed, and
the version I built from source. If I removed the Ubuntu package, I was
unable to correctly install Net::SSH2, as it couldn't find the
development headers. I don't know how to resolve this.
Anyway... I posted a question on Stackoverflow:
The answer from salva suggested using Net::OpenSSH::Compat::SSH2, which
is a "Net::OpenSSH adapter for Net::SSH2 API compatibility". I tried
his suggestion, and it solved the problem. I've yet to test it with
Bricolage, but I thought it worth mentioning in case others want to try it.
There's also Net::SFTP::Foreign::Compat which provides an adapter for
Note that the author states that these are mature modules. However,
they may be of use as a quick fix for those experiencing problems in
2.0.1 with SFTP.
One way to use them is to patch Bric::Util::Trans::SFTP. Just add the
following lines at the start of the Programmatic Dependencies section,
before the existing Net::* modules:
use Net::OpenSSH::Compat::SSH2 qw(:supplant);
use Net::SFTP::Foreign::Compat qw(:supplant);
Again, I haven't tested this, and the modules may be buggy!