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

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

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

    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?
        Something is wrong with your ssh configuration.

        Try login as the apache user on the local machine and connecting to the remote host from the command line.

        # su - apache $ ssh -l user 192.168.1.181

        Once you get that to work, you should be able to connect from your script using Net::SSH::Expect!