in reply to Re: Net::SSH::Expect login using SSH keys
in thread Net::SSH::Expect login using SSH keys

print "$@"; $test = $ssh->read_line(); print "$test";

Here $test is printing as Could not create directory '/var/www/.ssh'. on my browser.

I tried with the ncoadmin (a non-root, existing system user). But the same error I'm getting when I tried to run this connection by sending the $rusr as 'blahblah'...

Replies are listed 'Best First'.
Re^3: Net::SSH::Expect login using SSH keys
by perl_lover (Chaplain) on Dec 07, 2010 at 13:44 UTC
Re^3: Net::SSH::Expect login using SSH keys
by cjb (Friar) on Dec 07, 2010 at 13:33 UTC

    What effective user is this script running under? Do they have permission to write to /var/www ?

    Net::SSH is just a wrapper around your local ssh command, so could this be an underlying permissions issue?

    Maybe Net::SSH::Perl is an option?

    Edited to correct links 20101207 @ 13:34 - CB
      I have changed the permission of /var/www to 777. Now I'm getting the error as

      The authenticity of host '192.168.1.181 (192.168.1.181)' can't be established.

      I can say that, the SSH is not happening with the user we are mentioning in the Net::SSH::Expect connection. It is always happening as apache (since it is trying to create a directory under /var/www).

        Is '192.168.1.181' in .ssh/knownhosts for the user the script is running as?