SFTP with user and password with libssh2
Daniel Nashed – 13 December 2025 18:09:09
Here is the challenge
lftp and curl compiled in the right way, support SFTP with user/password required for HCL ticket uploads.
As explained earlier UBI does have an easy path to support SFTP with user/password.
The mission is to have SFTP support without new dependencies
I took another look of what options we have without introducing a new dependency to the container image.
Here is the idea: libssh2 is easy to use and supports user/password (https://github.com/libssh2/libssh2).
nshmailx is already a C/C++ application which statically links OpenSSL on Alpine. The same works also for libssh2.
Here is the new code I just added -> https://github.com/nashcom/nshmailx/blob/main/sftp.cpp
I am still testing it. But here are the new options for SFTP Put -> https://github.com/nashcom/nshmailx/
Now I am waiting for HCL support to explain how the flow works to get a user/password for upload along with the ticket number (https://support.hcl-software.com/csm?id=kb_article&sysparm_article=KB0010064).
The idea is to integrate the upload into the Domino diagnostic script.
Update: Added a performance counter, checksum support for get/put. a larger buffer of 1 MB brings better performance. The output now looks like this:
nshmailx -sput 127.0.0.1 -user notes -password xxx -local Domino_14.5.1_Linux_English_EA1.tar -remote Domino_14.5.1_Linux_English_EA1.tar -sha
Connecting to 127.0.0.1 (127.0.0.1:22)
SSH host key [ssh-ed25519] SHA256:DLIJRAR37twu6SPWczkMUW/ZJuU1Wx4zRSEpb58rBTo
Upload successful: Domino_14.5.1_Linux_English_EA1.tar -> Domino_14.5.1_Linux_English_EA1.tar (size 1.1 GB, transfer: 271.7 MB/sec, SHA256: b950cdfecf0d87d89a6ca64c8e24b5c23e46724b364cb34e2a1d84a124a1742e)
- Comments [0]