phpseclib

phpseclib - Can I connect using username, key and password (not a key passphrase)

旧时模样 提交于 2019-11-27 15:24:30
Apologies if I have missed this in the documentation but is it possible to connect to an SFTP server with a private key and a password (not a passphrase for my private key). The examples show username/password, username/key and username/key/key passphrase authentication types. When connecting via the command line I would get this prompt for my password... user@x.x.x.x's password: Hopefully this library can handle this? Otherwise are there any other PHP based solutions that might support username/key and server password authentication? I'm quite flexible here and can install modules if need be.

phpseclib - Can I connect using username, key and password (not a key passphrase)

a 夏天 提交于 2019-11-26 22:25:20
问题 Apologies if I have missed this in the documentation but is it possible to connect to an SFTP server with a private key and a password (not a passphrase for my private key). The examples show username/password, username/key and username/key/key passphrase authentication types. When connecting via the command line I would get this prompt for my password... user@x.x.x.x's password: Hopefully this library can handle this? Otherwise are there any other PHP based solutions that might support

How to SFTP upload files from PHP

社会主义新天地 提交于 2019-11-26 17:07:20
问题 I'm having trouble using PHP to SFTP upload files to a remote server. When I use cURL, I'm getting the error described here: SFTP from PHP - undefined constant CURLOPT_PROTOCOLS and CURLPROTO_SFTP? I also tried phpseclib as suggested in: SFTP from within PHP But when i try phpseclib, i get these errors: Warning: require_once(Math/BigInteger.php) [function.require-once]: failed to open stream: No such file or directory in /home/john/public_html/test/Net/SSH2.php on line 53 Fatal error: require

removing password from rsa private key

心不动则不痛 提交于 2019-11-26 14:49:13
问题 Here's how I'd do it with phpseclib (which works): <?php include('Crypt/RSA.php'); $rsa = new Crypt_RSA(); $rsa->setPassword('password'); $result = $rsa->loadKey('-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,E3B1C06E0D0C2633 gvmXzl6W7eV1a3N5rQNwBWKY9on3IgxZudS33cip5f88FotsPSDJMvqj6LVw2RxobDjhlOOzqmTb VrlTnoQ6CogXFZSfiPmixiyyptCUEKJkSiEhYGM5GQm0OoGcLeLbgBb9tRpWh5IlXulKD6XFhx8q /eGg5a+mSkX1i7kv2+Ih3jHmEKwrnfzhcA29pBF3OQJo+Ks9IYneuk676pHtsIs7CpFKq1tDvD8Q