fsabattier
fsabattier

Reputation: 163

Php ssh2_auth_password authentication failed

My php script generates an excel file, and I'd like this file to be transfered on our files server, which is different from the web one.

I'm using the ssh2_auth_password() function, but I'm stuck with the Warning: ssh2_auth_password() [function.ssh2-auth-password]: Authentication failed for root using password message.

Most of time, this issue is fixed by changing the line PasswordAuthentication yes on the sshd_config file. This is done and confirmed by the function ssh2_auth_none() which returns an array containing : "0: publickey, 1: password, 2: keyboard-interactive"

When I execute the operation by putty (typing scp /srv/www/htdocs/**** [email protected]:/***/***), and giving the password, it works.

Any ideas ?

Upvotes: 0

Views: 6059

Answers (1)

fsabattier
fsabattier

Reputation: 163

Finally, I just had to remove the ssh2_auth_none(), and it works !

Upvotes: 1

Related Questions