Skip to Content

Compile and install libssh and ssh2

How to compile and install libssh (1.10.0) and ssh2 (1.3.1) in Ubuntu 18, 20, 22, and Centos 7, 8?

1. Download required packages:

[email protected] ~]# wget https://libssh2.org/download/libssh2-1.10.0.tar.gz

[email protected] ~]# wget https://pecl.php.net/get/ssh2-1.3.1.tgz

2. Compile and install libssh 1.10.0

[email protected] ~]# tar vxzf libssh2-1.10.0.tar.gz

[email protected] ~]# cd libssh2-1.10.0

[email protected] ~]# ./configure

[email protected] ~]# make

[email protected] ~]# make install

3. Compile and install ssh2 1.3.1

[email protected] ~]# tar vxzf ssh2-1.3.1.tgz

[email protected] ~]# cd ssh2-1.3.1

[email protected] ~]# phpize

[email protected] ~]# ./configure --with-ssh2

[email protected] ~]# make

[email protected] ~]# make install