Perl, SSH, and Windows

runrig on 2009-07-24T16:39:35

It's been a while since I've used SSH...most companies I've worked at just use plain telnet. And SSH is one of those things that once set up, you forget about, so you keep having to relearn it. I got two logins set up with public key auth, but a third would only work with a password. I finally learned about the StrictModes setting in the sshd config...the permissions on my home directory were 777. Changed it to not be world-writable and now the public key auth works.

And I've set up my work provided Windows laptop with Perl (of course), Vim, MSYS, and Firefox. I wanted to automate some SFTP file transfers, and was not having any luck/progress with Net::SFTP or Net::SFTP::Foreign and their dependencies. Then a post on perlmonks directed me to Net::SSH2, which does ssh, scp, and sftp. Net::SSH2 is definitely the easiest to get working on Windows.


Net::SSH2

Mr. Muskrat on 2009-07-24T16:56:34

I tried using Net::SSH2 here on the job and most things just work.

I have not had much luck with Net::SSH2::SFTP though. I need to write up a good test case so that I can submit a bug report.

Re:Net::SSH2

Mr. Muskrat on 2009-07-24T17:01:47

Net::SSH2::SFTP may just work for you though because I forgot to mention that I was using it from Linux to connect to Windows (running Cygwin's sshd).

I ended up using Net::SFTP::Foreign because, for me, it just works.

Re:Net::SSH2

runrig on 2009-07-24T17:39:25

Yes, I am using it just to connect from Windows to Unix. So it just works for me :-)

On the Unix side, they don't appear to use perl much. The installed version is 5.6.1 with no non-core modules. I've only seen a couple of one-liners in a couple of shell scripts...so I don't expect to be doing much perl on Unix here, unless I can come up with an overwhelming case (and and convince them that it's overwhelming).

Re:Net::SSH2

runrig on 2009-07-24T17:48:52

Aha...I just found perl 5.8.5 installed in /usr/local/bin :-) ...but still no non-core modules :-(