PHP ssh2://


The libssh2 library provides access to resources on a remote machine using a secure cryptographic transport. These are shell, remote exec, tunneling, file transfer and SCP. PHP has wrappers for these resources. They are, ssh2.exec://, ssh2.tunnel://, ssh2.sftp://, and ssh2.scp:// respectively

Note that these wrappers are not enabled by default. SSH2 extension available from PECL must be installed.


ssh2.*// context options

sessionPreconnected ssh2 resource to be reused
sftpPreallocated sftp resource to be reused
methodsKey exchange, hostkey, cipher, compression, and MAC methods to use callbacks
usernameUsername to connect as
passwordPassword to use with password authentication
pubkey_fileName of public key file to use for authentication
privkey_fileName of private key file to use for authentication
envAssociate array of environment variables to set
termTerminal emulation type to request when allocating a pty
term_widthWidth of terminal requested when allocating a pty
term_heightHeight of terminal requested when allocating a pty
term_unitsUnits to use with term_width and term_height