if you're trying to connect to an ssh server in an environment where the ssh2 extension cannot be installed this pure-php implementation may be helpful:
http://phpseclib.sourceforge.net/documentation/net.html
Fonctions Shell2 sécurisé
- Introduction
- Installation/Configuration
- Constantes pré-définies
- Fonctions Shell2
- ssh2_auth_hostbased_file — Identification en utilisant une clé d'hôte publique
- ssh2_auth_none — Identification en tant que "none"
- ssh2_auth_password — Identification via SSH en utilisant un mot de passe en clair
- ssh2_auth_pubkey_file — Identification en utilisant une clé publique
- ssh2_connect — Connexion à un serveur SSH
- ssh2_exec — Exécute une commande sur un serveur distant
- ssh2_fetch_stream — Parcours un flux étendu de données
- ssh2_fingerprint — Récupère l'empreinte d'un serveur distant
- ssh2_methods_negotiated — Retourne une liste de méthodes négociées
- ssh2_publickey_add — Ajoute une clé publique autorisée
- ssh2_publickey_init — Initialise un Publickey Subsystem (sous-système de clé publique)
- ssh2_publickey_list — Liste les clés publiques actuellement autorisées
- ssh2_publickey_remove — Supprime un clé publique autorisée
- ssh2_scp_recv — Demande un fichier via SCP
- ssh2_scp_send — Envoie un fichier via SCP
- ssh2_sftp_lstat — Statue un lien symbolique
- ssh2_sftp_mkdir — Crée un dossier
- ssh2_sftp_readlink — Retourne la cible d'un lien symbolique
- ssh2_sftp_realpath — Résout le chemin réel d'un chemin fourni
- ssh2_sftp_rename — Renomme un fichier distant
- ssh2_sftp_rmdir — Efface un dossier
- ssh2_sftp_stat — Statue un fichier sur un système de fichiers distant
- ssh2_sftp_symlink — Crée un lien symbolique
- ssh2_sftp_unlink — Efface un fichier
- ssh2_sftp — Initialise un sous-système SFTP
- ssh2_shell — Demande un shell interactif
- ssh2_tunnel — Ouvre un tunnel à travers un serveur distant
SSH2
zelnaga+php at gmail dot com
25-Feb-2009 09:45
25-Feb-2009 09:45
steven at salvania dot be
08-Jan-2009 11:09
08-Jan-2009 11:09
For windows users only:
The PECL ssh2 extension is not able to use (at least) the pubkey authentication correctly, as well as it will crash at the point where the connection is closed because of the wrong functions being used under windows.
Thanks to some patches and comments from other users I was able to compile this extension and you can download it from:
http://www.salvania.be/tmp/php_ssh2__528.rar
This works (at least) with PHP 5.2.8. It is linked against libSSH2 v1.0 and OpenSSL v0.9.8i.
Have fun!
codeslinger at compsalot dot com
06-Aug-2008 04:36
06-Aug-2008 04:36
if you are trying to build this PECL extension because your distro does not already provide it.... then you need to apply a patch or else it won't "make". The problem is that libssh2 has changed the name and value of a conditional compile flag. See this bug for the fix.
http://pecl.php.net/bugs/bug.php?id=11779
P.S. if you are using Ubuntu 8.04 or earlier, the package request has already been filed.
tom at r dot je
03-Jul-2008 11:38
03-Jul-2008 11:38
As an alternative to using SSH2, it's easier to mount a remote file system ( http://ubuntu.wordpress.com/2005/10/28/
how-to-mount-a-remote-ssh-filesystem-using-sshfs/ ) and use the standard php copy() unlink() etc files.
