0

I would like to write a PHP script where I can easily test credential which I have for sftp connection, is right or wrong.

So I easily completed this script when I have user name and password but I have problem with public key. So what will be the code for checking the public means I have following information to connect with a server through ssh:-

host name:- domain.com port number:- 22 for authentication:- public key(.ppk file)

I am able to connect with filezilla but how can make the some connection with php script.

Saurabh
  • 356
  • 2
  • 10
  • possible duplicate of [How To Execute SSH Commands Via PHP](http://stackoverflow.com/questions/6270419/how-to-execute-ssh-commands-via-php) – Shahrokhian Feb 10 '14 at 08:29
  • I just would like to know the way how can I check the ssh credential detail are right or wrong using php script. So when some one will enter the 1. ftp host name , user name and password OR 2.ftp host name and privatekey into html form then I should able to know, these credential are right or wrong – Saurabh Feb 10 '14 at 10:56

1 Answers1

0

Here are the classes you are looking for : http://www.php.net/manual/en/book.ssh2.php

Madcoe
  • 213
  • 1
  • 6