Banshee06 has asked for the wisdom of the Perl Monks concerning the following question:

My Unix Admin.tells me that the Perl ssh and sftp are not supported by our O/S. Does any one know if this is true? I am trying to use sftp in Perl. Here is his message to me. "I've found RPMS for Red Hat AS4, but Net-SSH-Perl is unsupported by Red Hat. I haven't found any installation software targeted towards a 64-bit OS." also he said they are some bugs with the ssh module. "There appear to be a number of bugs with Net-SSH-Perl, some of them very old (the memory leak concerns me): https://rt.cpan.org/Public/Dist/Display.html?Status=Active&Name=Net-SSH-Perl "

Replies are listed 'Best First'.
Re: SFTP & SSH support in Red Hat AS4
by andyford (Curate) on Oct 05, 2006 at 16:16 UTC
    Just download it and try building and testing in your home dir.
    If the modules test OK, then take that info to your admins and see if they'll install it for you.
    If the admins won't install the module(s?) globally, then just install it in your home directory and run it from there.
    There's always a way, pretty much.
    As far as the bug reports go, I would take this as a good sign! Looks to me like this module has a solid group of users that care about the module and how it works.
    Peruse the bugs, if they don't look like they affect your usage of the module, then move forward and test.
    All software has bugs. Rejoice! In this case you actually know about some of them!

    Update: Addressing bug concerns.

    andyford
    or non-Perl: Andy Ford

      Hard to do since they wont let us programmers download anything. If I did would I have to install perl completely in my own directory even though it is already installed on the server?
Re: SFTP & SSH support in Red Hat AS4
by Khen1950fx (Canon) on Oct 05, 2006 at 20:36 UTC
    What your sysadmin said is not quite true. For instance, I'm on FC5 and FC6. Both have full 64-bit support for openssh protocols 1 and 2. There is also a 64-bit rpm for Net-SSH-Perl. Now, he may be confused about the meaning of SFTP. For our purposes, SFTP means "SSH File Transfer Protocol". If openssh is installed, then it's supported. On the other hand, SFTP could mean "SSH File Transfer Program"---that's more for commandline clients and not really what we're talking about.

    I think the real problem is that the sysadmin may have had a problem installing Net::SSH::Perl. It has some dependencies that are extremely difficult to install---Math::Pari and the Crypt modules. Math::Pari is the major stumbling block. There are 64-bit rpms for pari and Math::Pari. If he can't get it to install properly, then the Crypt modules won't either; hence, the Net::SSH::Perl installation won't be satisfactory.

      I found this on Cpan.. Is this the same things or something different? Bundle::SSH - A bundle to install modules to use SSH from Perl SYNOPSIS First you have to download and expand the PARI itself. See INSTALL PARI below. Then: perl -MCPAN -e 'force install Bundle::SSH' DESCRIPTION This bundle defines the modules you need to use SSH from Perl. Thre are two ways to do this. One is using Net::SSH which is a wrapper around the ssh command installed (or not) on your computer. It is simple to install and use but it depends on external executabel and has other drawbacks too. I have included it in this bundle. The other way which is more involved both in terms of installation and in the way you use it is called Net::SSH::Perl . It is a Perl/C implementation of the SSH protocol. This module should list all the required modules (and maybe more) to use either of the above way to ssh to another machine. It is organized in a way so it will be able to install everything without the need to install prerequsite modules
        Bundle::SSH is good. It can make things easier, but the problem of pari still remains. Installing pari requires a lot of time and experimentation, and the installation process varies from one machine to another because of dependencies. If the sysadmin can get pari installed right, then, by all means, try Bundle::SSH.
Re: SFTP & SSH support in Red Hat AS4
by salva (Canon) on Oct 06, 2006 at 07:40 UTC
    Try Net::SFTP::Foreign, it's an SFTP client that uses the ssh binary to connect to the remote server instead of Net::SSH::Perl. It doesn't require any additional module to work and is much faster.

    Its only drawbacks are that it doesn't support user/password authentication and that it doesn't work on Windows.

      But the main reason I am using perl is for the user/password authentication so I dont have to use expect. I already have a perl script using ftp I can easily use sftp in the same scritp If I can get sftp to work. Thanks
        Another option is the psftp program, part of the PuTTY set of utilities.

        It accepts the user and passwords as arguments on the command line, though this is not very secure as other users would be able to see then just running ps.