# Zabbix ssh agent issue
###### tags: `By_Ivan`
Ssh agent is a agent-less monitoring tool of Zabbix, acording to its document.
I can access to a remote server, execute some script, and return the output result.
## libssh bug
Zabbix ssh agent uses libssh to run. When using libssh version ***0.9.3*** or ***0.9.4***, somtime the connection would be timed-out, leading to error message:"***cannot read from ssh***."
This is caused by a bug from libssh, where its function incorrectly return "*Timeout*". <font color=blue>++This bug is expected to be fix in version 0.9.5++</font> ([Issue](https://support.zabbix.com/browse/ZBX-17756)), which has not been released officailly.
Theoretically, downgrading libssh could be a solution. However it is not guaranteed that the package manager and OS platform would support such feature. Thus, at present, upgrade and build the version 0.9.5 distribution is the only feasible approach to fix ssh agent.
## build from src (0.9.5)
[official download](https://www.libssh.org/files/0.9/)
### requirements
> reference from document: [INSTALL](https://github.com/substack/libssh/blob/master/INSTALL)
In order to build libssh, you need to install several components:
- A C compiler
- [CMake](https://www.cmake.org) >= 2.6.0.
- [openssl](https://www.openssl.org) >= 0.9.8
or
- [gcrypt](https://www.gnu.org/directory/Security/libgcrypt.html) >= 1.4
- [libz](https://www.zlib.net) >= 1.2
optional:
- [cmocka](https://cmocka.org/) >= 1.1.0
- [socket_wrapper](https://cwrap.org/) >= 1.1.5
- [nss_wrapper](https://cwrap.org/) >= 1.1.2
- [uid_wrapper](https://cwrap.org/) >= 1.2.0
- [pam_wrapper](https://cwrap.org/) >= 1.0.1
### build instructions
Install libssh version 0.9.5
```shell
wget https://www.libssh.org/files/0.9/libssh-0.9.5.tar.xz
tar Jxvf libssh-0.9.5.tar.xz
```
Create build directory
```shell
mkdir libssh-0.9.5/build
cd libssh-0.9.5/build/
```
Compile
```shell
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \ # install at "/usr"
-DCMAKE_BUILD_TYPE=Release \ # Debug|Release|MinSizeRel|RelWithDebInfo
-DUNIT_TESTING=ON # Requires cmocka
make
```
Install
```shell
make install
```
> For more detail, please read the official document: [INSTALL](https://github.com/substack/libssh/blob/master/INSTALL)
:::info
Theoretically, after compiling the src, the program can be distributed with our main application. (and install it afterward)</br></br>
As long as the license not being violated, this could be a better option in the sake of compatibility.
:::