Connect ssh to PHP to secure data transfer (1) _php tutorial

Source: Internet
Author: User
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.