$connection = ssh2_connect('sftp://xx.xx.xx.xx', 22) or die ('fail');
if (ssh2_auth_password($connection, 'user', 'password')) {
echo "Authentication Successful!\n";
} else {
die('Authentication Failed...');
}
// my result is: fail ;
Asked
Active
Viewed 680 times
-2

Muhammad Shahzad
- 9,340
- 21
- 86
- 130

Hari Yanto
- 3
- 2
-
Why are you using the `sftp://` prefix? – Devon Bessemer Jun 21 '16 at 06:00
-
my goodness, that's what makes this did not work. Thank you for your help – Hari Yanto Jun 21 '16 at 06:18
2 Answers
0
Filezilla, i think has nothing related in functions to php as it is not coded on it.
I would recommend you to check this answer
EDIT: Also check this from the php manual, sftp connections.
Please let me know if this works for you,
Tom

Community
- 1
- 1

Tomas Salazar
- 48
- 7
0
You don't need to put sftp://. Just the IP should be fine.
Also please format your code correctly for Stack Overflow.

Jonah
- 71
- 8