in reply to Re: Net::SSH::Perl - looking for someone to point me in the right direction
in thread Net::SSH::Perl - looking for someone to point me in the right direction

Sorry about the tags. I tried that but I think I'm use impaired.

Well, nothing, really. I work the ssh by hand and can see where the key information tries to write. I looked at all the files and found that I have a ./ssh in root and my_userid (which is expected). I turned on total use permissions for each just to see if it is trying to access one of these - but it's not.

So I went into the Hosts.pm file until Net::SSH::Perl and discovered the routine "sub _add_host_to_hostfile" is the one containing the check and error.

The code in there that errors is the following:

unless (-d $dir) { print "Inside the 'unless'". "<br / >"; require File::Path; File::Path::mkpath([ $dir ])


Now I'm pretty much stuck. I feel like the dullest person in the world right now. I apologize!

Thank you for the help. I AM happy to have it! REALLY!!
  • Comment on Re^2: Net::SSH::Perl - looking for someone to point me in the right direction
  • Download Code

Replies are listed 'Best First'.
Re^3: Net::SSH::Perl - looking for someone to point me in the right direction
by talexb (Chancellor) on Oct 04, 2005 at 20:27 UTC

    Why don't we back up a bit -- what are you trying to do, log on to an SSH session through a form?

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      Yes. From my original post:

      "I'm trying to use Net::SSH::Perl to establish a secure connection to a server through CGI. I'm the VERY first to admit that perhaps this may not be the way to go but I'm a new and needing advice. Please PLEASE offer any!

      I created a form with a 'post' to a cgi script. The cgi script tries to use Net::SSH::Perl to login to the server."

      If there is a better way to do this than I am game.

      In the long run I hope to use an HTML form to submit a job under a userid/password so that a job can execute as that user and return data to a directory owned by them.

      Does anyone else do this?

        Sorry -- the combination of GET and POST along with Net::SSH::Perl quite confused me.

        You've already got quite a good answer from brother graff below, but essentially the problem is that you're trying to execute a secure, asynchronous process using an insecure, synchronous medium. It's just not a good fit.

        Rather than focus on using Net::SSH, why not have a web application create a file in a certain location (perhaps based on the user's values in a form that you have them fill out), and have a cron job watch for the arrival of that file. When the file's arrival is noted, it can be moved (so it's not executed twice) and then used to execute a process, with the output data left in some suitable destination directory.

        You could even send E-Mail to the submitter when the process is complete, or if this is part of a larger web application, flag the user that their job is done.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds