Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: getting sftp to work with 2 different platforms and keypairs

by Aldebaran (Curate)
on Sep 16, 2019 at 19:12 UTC ( [id://11106255]=note: print w/replies, xml ) Need Help??


in reply to Re^2: getting sftp to work with 2 different platforms and keypairs
in thread getting sftp to work with 2 different platforms and keypairs

Like hippo, I think this doesn't have so much to do with perl (yet)... though since the next step after getting the keypairs working will be to try to connect using perl, and we'll probably be asked to help with that after this is working, it's a good starting point to have confirmation that Aldebaran can connect using putty directly... and then support of the perl connection can continue in the same thread. :-)

Let me first address the topicality. At this point, I'm addressing things that are implementation specific in a couple ways. First is that I am on the windows platform. It's truly one of the bummers of the windows platform that I have to fight to make this happen. Also, I wouldn't want bliako to think that I've lost faith in unix. The truth is that I would install a dual boot ubuntu, but I can't get the darn thing to restart cold and look at the thumb drive. So I have to live in windowsland on my nice new machine for the time being.

Additionally, this question is implementation specific in that it considers Strawberry Perl first. I took soonix's downthread advice and installed Git, and with the way perl is behaving, I'm genuinely confused. For those uninterested in this implementation-specific problem, I invite you to skip the content between the readmore tags (maybe the entire thread if you're tired of posts about getting strawberry perl configured):

I thought I might do an end around with the keypairs-auth problem by writing the sftp routine to work by password instead:

C:\Users\tblaz\Documents\evelyn\tja\1.betsy>perl 1.betsy1.pl ... execution was here $VAR1 = bless( { 'my_sftp' => { 'password' => 'z', 'username' => 'y', 'domain' => 'x', 'port' => '22' } }, 'Config::Tiny' ); values are x y z 22 password authentication not available, IO::Pty is not installed or fai +led to load: Can't locate IO/Pty.pm in @INC (you may need to install +the IO::Pty module) (@INC contains: template_stuff C:\Users\tblaz\per +l5\lib\perl5/5.30.0/MSWin32-x64-multi-thread C:\Users\tblaz\perl5\lib +\perl5/5.30.0 C:\Users\tblaz\perl5\lib\perl5/MSWin32-x64-multi-thread + C:\Users\tblaz\perl5\lib\perl5 C:/Strawberry/perl/site/lib C:/Strawb +erry/perl/vendor/lib C:/Strawberry/perl/lib) at C:\Users\tblaz\perl5\ +lib\perl5/Net/SFTP/Foreign/Backend/Unix.pm line 256. at template_stuff/trans1.pm line 100. C:\Users\tblaz\Documents\evelyn\tja\1.betsy>

This is the routine that produces this output:

sub get_tiny { use 5.011; use warnings; use Net::SFTP::Foreign; use Config::Tiny; use Data::Dumper; my $ini_path = qw( C:\Users\tblaz\Documents\html_template_data\4.val +ues.ini ); say "ini path is $ini_path"; say "execution was here"; my $sub_hash = "my_sftp"; my $Config = Config::Tiny->new; $Config = Config::Tiny->read( $ini_path, 'utf8' ); say Dumper $Config; # -> is optional between brackets my $domain = $Config->{$sub_hash}{'domain'}; my $username = $Config->{$sub_hash}{'username'}; my $password = $Config->{$sub_hash}{'password'}; my $port = $Config->{$sub_hash}{'port'}; #dial up the server say "values are $domain $username $password $port"; my $sftp = Net::SFTP::Foreign->new( $domain, more => '-v', user => $username, port => $port, password => $password ) or die "Can't connect: $!\n"; return $sftp; }

All those paths in @INC looked like they're jacked up, as if the forward and backward slashed are having a tug of war.(?) But what really stands out to me in this output is that it did not change one bit when I added

 more     => '-v',

On linux, this option shows you what the backend is doing with verbosity. My current working theory is that I have no back end.

In the original post, I posted output that was suggestive that I need to use MingW to create the backend. Is this indeed the case?

Fishing for tips,

Replies are listed 'Best First'.
Re^4: getting sftp to work with 2 different platforms and keypairs (updated)
by soonix (Canon) on Sep 16, 2019 at 21:53 UTC
    As mentioned elsewhere, git for Windows includes its own Perl. This seems to interfere with your Strawberry Perl.

    AFAIR the git installation asks how to handle the PATH, my choice is usually the most cautious one, and I call Strawberry Perl usually via the portableshell.bat to avoid this situation.

    Update: You probably checked "Use Git and optional Unix tools from the Command Prompt", my choice is usually "Git from the command line and 3rd-party software", or (seldom) "from Git Bash only".

    I don't know, however, whether it is sufficient to remove something from the system PATH, or you'd need to un- and reinstall git to change this setting.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11106255]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found