Connect SSH to PHP to ensure data transmission security (1) _ PHP Tutorial

Source: Internet
Author: User
Tags php cli
Connect SSH to PHP to ensure data transmission security (1 ). SSH can transmit data by encrypting the online packets. SSH can be used to encrypt all transmitted data, even if someone intercepts data, it cannot obtain useful information. SSH can transmit data by encrypting the online packets. SSH can be used to encrypt all transmitted data, even if someone intercepts the data, they cannot obtain useful information. At the same time, data is compressed, which greatly speeds up transmission. In short, the use of SSH ensures that data transmission is secure and the transmission efficiency is high.

However, not everyone knows the features that PHP can connect to SSH and the ability to execute remote commands, but this is very useful. Since PHP can be used in many different ways, it has many configuration options to control its behavior. A large set of optional parameters can ensure that you can use PHP for many different purposes, but it also means that the combination of these parameters and server configuration will bring some security issues. I have been using SSH in php cli applications. I used it from cronjobs, but it was not very simple at the beginning. it can be said that it was a great deal of money. The manual on secure use of the Shell2 function is not very practical either. I have conducted many tests before having published this article. I hope you can save some time for configuring PHP after reading this article.

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 corresponding content in this article with the data package manager provided by your Linux release.

You are running PHP5. if you are not running PHP5, use PHP4 instead.

You have a basic understanding of PHP and server management.

You have installed PHP.

Prerequisites

Installation 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

After the installation is complete, go to the next step.

Compile libssh2

After downloading Libssh2 from the sourceforge website, we need to compile it, but don't worry, you just need to follow the steps below:

Cd/usr/src
Wget

...

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.