PHP Secure Shell2 Functions
EditRocket provides the following information on Secure Shell2 functions in the PHP source code builder.
bool ssh2_auth_hostbased_file ( resource $session , string $username , string $hostname , string $pubkeyfile , string $privkeyfile [, string $passphrase [, string $local_username ]] ) - Authenticate using a public hostkey read from a file.
mixed ssh2_auth_none ( resource $session , string $username ) - Attempt none authentication which usually will (and should) fail. As part of the failure, this function will return an array of accepted authentication methods.
bool ssh2_auth_password ( resource $session , string $username , string $password ) - Authenticate over SSH using a plain password
bool ssh2_auth_pubkey_file ( resource $session , string $username , string $pubkeyfile , string $privkeyfile [, string $passphrase ] ) - Authenticate using a public key read from a file.
resource ssh2_connect ( string $host [, int $port [, array $methods [, array $callbacks ]]] ) - Establish a connection to a remote SSH server.
resource ssh2_exec ( resource $session , string $command [, string $pty [, array $env [, int $width [, int $height [, int $width_height_type ]]]]] ) - Execute a command at the remote end and allocate a channel for it.
resource ssh2_fetch_stream ( resource $channel , int $streamid ) - Fetches an alternate substream associated with an SSH2 channel stream. The SSH2 protocol currently defines only one substream, STDERR, which has a substream ID of SSH2_STREAM_STDERR (defined as 1).
string ssh2_fingerprint ( resource $session [, int $flags ] ) - Returns a server hostkey hash from an active session.
array ssh2_methods_negotiated ( resource $session ) - Returns list of negotiated methods.
bool ssh2_publickey_add ( resource $pkey , string $algoname , string $blob [, bool $overwrite [, array $attributes ]] ) -
resource ssh2_publickey_init ( resource $session ) - Request the Publickey subsystem from an already connected SSH2 server.
array ssh2_publickey_list ( resource $pkey ) - List currently authorized publickeys.
bool ssh2_publickey_remove ( resource $pkey , string $algoname , string $blob ) - Removes an authorized publickey.
bool ssh2_scp_recv ( resource $session , string $remote_file , string $local_file ) - Copy a file from the remote server to the local filesystem using the SCP protocol.
bool ssh2_scp_send ( resource $session , string $local_file , string $remote_file [, int $create_mode ] ) - Copy a file from the local filesystem to the remote server using the SCP protocol.
resource ssh2_sftp ( resource $session ) - Request the SFTP subsystem from an already connected SSH2 server.
array ssh2_sftp_lstat ( resource $sftp , string $path ) - Stats a symbolic link on the remote filesystem without following the link.
bool ssh2_sftp_mkdir ( resource $sftp , string $dirname [, int $mode [, bool $recursive ]] ) - Creates a directory on the remote file server with permissions set to mode.
string ssh2_sftp_readlink ( resource $sftp , string $link ) - Returns the target of a symbolic link.
string ssh2_sftp_realpath ( resource $sftp , string $filename ) - Translates filename into the effective real path on the remote filesystem.
bool ssh2_sftp_rename ( resource $sftp , string $from , string $to ) - Renames a file on the remote filesystem.
bool ssh2_sftp_rmdir ( resource $sftp , string $dirname ) - Removes a directory from the remote file server.
array ssh2_sftp_stat ( resource $sftp , string $path ) - Stats a file on the remote filesystem following any symbolic links.
bool ssh2_sftp_symlink ( resource $sftp , string $target , string $link ) - Creates a symbolic link named link on the remote filesystem pointing to target.
bool ssh2_sftp_unlink ( resource $sftp , string $filename ) - Deletes a file on the remote filesystem.
resource ssh2_shell ( resource $session [, string $term_type [, array $env [, int $width [, int $height [, int $width_height_type ]]]]] ) - Open a shell at the remote end and allocate a stream for it.
resource ssh2_tunnel ( resource $session , string $host , int $port ) - Open a socket stream to an arbitrary host/port by way of the currently connected SSH server.