libssh
is a widely used open source C library implementing the SSH protocol. It allows us to remotely execute commands and transfer files using the SSH protocol.
libssh
is structured in a way that abstracts network connections. We won't need to bother with the low-level networking APIs we've been using so far. The libssh
library handles hostname resolution and creation of the needed TCP sockets for us.
Before continuing with this chapter, it is essential that you have the libssh
library installed and available. Please refer to Appendix B, Setting Up Your C Compiler on Windows, Appendix C, Setting Up Your C Compiler on Linux, and Appendix D, Setting Up Your C Compiler on macOS, for libssh
installation.
Our first program using libssh
is designed to ensure that it's installed correctly. This program merely prints the libssh
library version. The program is as follows:
/*ssh_version.c*/ #include "chap11.h" int main() { printf("libssh version: %s\n", ssh_version(0))...