I can connect securely to my Linux server on Windows using puTTY and Core FTP LE, both to root and to user.
But I want to connect using a Windows PHP program to user using the ssh2 library.
I’ve tried connecting three ways:
-
using the .crt and .key files for the LetsEncrypt certificate for my website,
-
using the rsa private key and .pub files for my user SSH access (via Webuzo, which is similar to cPanel),
-
using the .ppk and .pub files for my user SSH access.
In each case, I get a FALSE (error) value from sh2_auth_pubkey_file.
The functions I am calling are:
Connect:
ssh2_connect(SF::$sec['hostIP'], (int)SF::$sec['securePort']);
Auth:
sh2_auth_pubkey_file(SF::$sftp,SF::$sec['user'],SF::$sec['publicKeyPath'], SF::$sec['privateKeyPath'],SF::$sec['privateKeyPwd']);
4