1834711 Members
2474 Online
110069 Solutions
New Discussion

Net::SFTP

 
jerry1
Super Advisor

Net::SFTP

Where can I find Net::SFTP to put in
/opt/perl? The one I found does not compile
very well and the make install wants to put
it in /ots/perl/... not /opt/perl.

Is there an HP depot version?

I need to be able to do multiple file
transfers and ftp has been blocked so
Net::FTP is no longer working.

I could use Expect but do not know how to
do multiple file transfers. Expect does not
understand "*" wildcard. Using scp requires
passing password and so cannot use "for" loop
in sh.
9 REPLIES 9
Steven Schweda
Honored Contributor

Re: Net::SFTP

> Where can I find [...]

> I need to be able to do [...]

Which problem are you trying to solve,
getting some perl module to work, or finding
some way to S-transfer some files?

> [...] Expect does not
> understand "*" wildcard. [...]

Why should "expect" understand any wildcard?

> Using scp requires passing password [...]

It does? Who set up your public key stuff?

ra# uname -a
SunOS ra 5.10 Generic_127127-11 sun4u sparc SUNW,UltraSPARC-IIi-cEngine

ra# ls -l fred*
-rwxr-xr-- 1 sms 20 34 Aug 23 22:46 fred.dat
-rwxr-xr-- 1 sms 20 34 Aug 23 22:46 fred2.dat

alp $ tcpip show version

HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 7
on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2

alp $ scp ra:"fred*" .
fred.dat | 34B | 0.0 kB/s | TOC: 00:00:01 | 100%
fred2.dat | 34B | 0.0 kB/s | TOC: 00:00:01 | 100%

alp $ dire /date /prot /size

Directory ALP$DKA0:[SMS.FTPTEST]

FRED.DAT;1 1 4-SEP-2008 00:06:26.41 (RWD,RWD,R,)
FRED2.DAT;1 1 4-SEP-2008 00:06:26.51 (RWD,RWD,R,)

Total of 2 files, 2 blocks.


If I had more time to waste, I expect that I
could do all of that with HP-UX, too, but
these things were up and running already.

Perhaps it would help if you could describe
more clearly exactly what you need to do,
and, perhaps, what you have tried which
doesn't act as you'd like.
jerry1
Super Advisor

Re: Net::SFTP

Lets try this again.

Where can I find Net::SFTP to put in
/opt/perl? The one I found does not compile
very well and the make install wants to put
it in /ots/perl/... not /opt/perl.

Is there an HP depot version?



Ignore the rest since all you want to do is banter about that.
James R. Ferguson
Acclaimed Contributor

Re: Net::SFTP

Hi:

You can fetch Net::SFTP from CPAN:

http://search.cpan.org/~dbrobins/Net-SFTP-0.10/lib/Net/SFTP.pm

...but it is hard to get installed:

http://deps.cpantesters.org/?module=Net%3A%3ASFTP&perl=5.8.8&os=any+OS

> Using scp requires passsing password...

No, not if you setup public keys. See Matti's post here:

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1254688

Regards!

...JRF...
jerry1
Super Advisor

Re: Net::SFTP

Yes, I added pub key.
Thanks.
James R. Ferguson
Acclaimed Contributor

Re: Net::SFTP

Hi (again) Jerry:

> Yes, I added pub key.

Then, you could also use SFTP in a shell script with a batch file, along the lines of:

...
sftp -v -b - <lcd /localpath
cd /remotepath
get -P ${FILE} ${FILE}.local
EOF
...

Regards!

...JRF...
Steven Schweda
Honored Contributor

Re: Net::SFTP

Sorry if my "banter" distracted you. I
thought that I was demonstrating that one
could use scp with wildcard file names, and
the it didn't really require passing a
password (contrary to your claim).

Lacking a clear description of the problem
you're really trying to solve, non-psychics
(like me) sometimes take a stab in the dark,
in the hope of providing some useful
information. Sometimes we fail.
jerry1
Super Advisor

Re: Net::SFTP

Yes James, the first one from cpan was
looking like it was going to be a real
pain to modify to make it work and I did
not have the time since I was in a
production down outage that needed to be
fixed immediately. I did end up just
putting scp in the script that called the
perl script to that did do the Net::FTP.
I like using the NET::FTP since I can trap
error messages at any point.

Travis B Cox
New Member

Re: Net::SFTP

try using Net::SFTP::Foreign

its a much easier install

perl -MCPAN -e shell

install Net::SFTP::Foreign

jerry1
Super Advisor

Re: Net::SFTP

It's not possible to download.
When I click on the download I get the error at http://cpan.uwinnipeg.ca/dist/Net-SFTP-Foreign:

Content Encoding Error (content_encoding_error)


Server response could not be decoded using encoding type returned by server.
This is typically caused by a Web Site presenting a content encoding header of one type, and then encoding the data differently.

For assistance, contact your network support team.


It's all going to hell real fast like our
economy.