SSH can be transmitted by the technology of the online packet encryption, using SSH to encrypt all the data transferred, even if someone intercepts the data will not be able to obtain useful information. At the same time, the data is compressed, which greatly accelerates the transmission speed. In short, the use of SSH can ensure that data transmission is more secure and efficient transmission.
However, not everyone knows the features of PHP that can be connected to SSH and the ability to execute remote commands, but this is useful. Since we can make use of PHP in many different ways, it has many settings options to control its behavior. A large set of optional parameters guarantees that you can use PHP for many different purposes, but it also means that the combination of these parameters and the server-side configuration poses some security issues. I have been using SSH in the PHP CLI application, I use it from the cronjobs, but it was not very simple at first, can say quite a lot of trouble. The manual on the safe use of the SHELL2 function is not very practical, the author after many tests have been today this small article, I would like you to read after you can configure PHP to save a bit of time.
In this article, I need to assume that:
The operating system you are running is debian/ubuntu. If you are not running Debian/ubuntu, you may need to replace the contents of this article with the packet manager provided by your Linux distribution.
You are running PHP5. If you are not running PHP5, you can use PHP4 instead.
You have a basic understanding of PHP and Server management.
You have already installed PHP.
Prerequisite
Install package
First, let's install the following package:
sudo aptitude update
sudo aptitude install Php5-dev php5-cli php-pear buid-essential
Openssl-dev Zlib1g-dev
The installation is complete and goes to the next step.
Compiling LIBSSH2
After downloading Libssh2 from the SourceForge website, we need to compile it, but don't worry, just follow the steps below:
Cd/usr/src
Wget
http://www.bkjia.com/PHPjc/446794.html www.bkjia.com true http://www.bkjia.com/PHPjc/446794.html techarticle SSH can be transmitted by the technology of the online packet encryption, the use of SSH can be transferred all the data to encrypt, even if someone intercepted the data can not get useful information ...