I am attempting to write code in perl that would allow me to download files from COSMICs SFTP server. I have never done this and I believe that is the major source of my troubles. I have been able to login using HTTP::Request::Common at https://cancer.sanger.ac.uk/cosmic/login, but in terms of accessing the SFTP server I have not had much luck.
use strict; use warnings; use Net::SFTP; my $SFTPSite = "sftp-cancer.sanger.ac.uk"; my $userid = "username\@email.com"; my $pword = "*********"; my $sftp = Net::SFTP->new( $SFTPSite, $userid, $pword ) or die "Could NOT create SFTP\n";
My error message:
Can't connect to sftp-cancer.sanger.ac.uk, port 22: Connection timed out at /home/jcook/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux/Net/SSH/Perl.pm line 215.
Any suggestions would be greatly appreciated