Home  >  Article  >  Backend Development  >  PHP ssh2://

PHP ssh2://

王林
王林forward
2023-09-15 13:05:021412browse

PHP ssh2://

Introduction

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

Please note that these wrappers are not enabled by default. The SSH2 extension provided by PECL must be installed.

Usage

ssh2.shell://user:pass@example.com:22/xterm
ssh2.exec://user:pass@example.com:22/usr/local/bin/somecmd
ssh2.tunnel://user:pass@example.com:22/192.168.0.1:14
ssh2.sftp://user:pass@example.com:22/path/to/filename

ssh2.*// Context options

session Pre-connected to be reused ssh2 resource
sftp Pre-allocated sftp resource to be reused
methods Use Key exchange, host key, encryption, compression and MAC methods for callbacks
username Username to connect to
password Password used for password authentication
pubkey_file Pubkey file name used for authentication
privkey_file Name of the private key file used for authentication
env Associative array of environment variables to set
term Terminal emulation type requested when allocating pty
term_width When allocating pty Requested terminal width
term_height Requested terminal height when allocating pty
term_units Units to use with term_width and term_height

The above is the detailed content of PHP ssh2://. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete