libssh2 and libssh both implement SSH and provide a library API for
apps. Both support SSH, SFTP, auth, channels etc. Both are 25K-30K
lines of code.
Here's an attempt to put some light on the differences between them.
libssh2 1.2.5
- Modified BSD licensed
- Can set the API to either blocking or non-blocking
- client-side only
- stable API
- strict name space - everything is in libssh2_* something
- C89 compatible
- SSH v2 only (not v1)
- all 100+ functions are documented in their own man pages
- autotools-based building
- LGPL licensed
- Has a blocking API, although parts can be used non-blocking
- client-side and server-side support
- API that still changes
- name space pollution - uses lots of (generic) prefixes like 'ssh',
'channel', 'buffer', 'string' (and some even without prefix)
- C99 support required
- optional SSH version 1 support
- brief doxygen-generated docs
- CMake-based building
Feature by feature
The same data, in a table:
| item | libssh2 | libssh |
| Licence |
Modified BSD |
LGPL |
| Non-blocking API |
everything |
parts |
| Server-side supported |
no |
yes |
| Stable API |
yes |
no |
| C compatibility |
C89 |
C99 |
| strict namespace |
yes |
no |
| man pages for all functions |
yes |
no |
| SSHv1 support |
no |
yes |
| Build concept |
Autotools |
CMake |