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

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
  • Comment on Re^3: Net::SSH::Expect login using SSH keys

Replies are listed 'Best First'.
Re^4: Net::SSH::Expect login using SSH keys
by ashok.g (Beadle) on Dec 07, 2010 at 13:46 UTC
    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?

        I added the host to known_hosts. Now, I'm able to get the SSH reference. But, no command is executing via $ssh.
        $ssh->send("ls");
        Here it is again asking for password. Why?