Registry /
testing / robotframework-sshlibrary
Install & Compatibility
Where this runs
tested against v3.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 49.8MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 4.3s · import 0.000s · 50MB
48MB installed
● package 48MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SSHLibrary
✓ *** Settings ***
Library SSHLibrary
✗ from SSHLibrary import SSHLibrary
Robot Framework libraries are imported using the 'Library' setting in the Settings section of a .robot file, not with Python-style 'from import'.
This example connects to a remote SSH server using environment variables for credentials, executes a simple `ls -l /tmp` command, logs the output, asserts a part of the output, and then closes the connection. Set `SSH_HOST`, `SSH_PORT`, `SSH_USERNAME`, and `SSH_PASSWORD` environment variables before running.
*** Settings ***
Documentation Demonstrates SSHLibrary connection and command execution.
Library SSHLibrary
*** Variables ***
${SSH_HOST} ${OS_ENVIRONMENT_SSH_HOST}
${SSH_PORT} ${OS_ENVIRONMENT_SSH_PORT}
${SSH_USERNAME} ${OS_ENVIRONMENT_SSH_USERNAME}
${SSH_PASSWORD} ${OS_ENVIRONMENT_SSH_PASSWORD}
*** Test Cases ***
Execute Remote Command
[Tags] SSH
Open Connection ${SSH_HOST} port=${SSH_PORT}
Login ${SSH_USERNAME} ${SSH_PASSWORD}
${output}= Execute Command ls -l /tmp
Log To Console Command Output: ${output}
Should Contain ${output} total
Close Connection
Debug
Known issues
breakingSSHLibrary 3.0.0 introduced Python 3 support (Python 2.7, 3.4+). Older versions of SSHLibrary may not be compatible with newer Python 3 versions, and newer SSHLibrary versions (e.g., 3.8.0 onwards) officially support Python 3.6+.fixEnsure your Python environment matches the SSHLibrary version's requirements. Upgrade SSHLibrary and Python if necessary.
affects: < 3.0.0 for Python 3; < 3.8.0 for Python 3.6+
breakingIn SSHLibrary 3.0.0, the `Login with Public Key` keyword arguments changed. Specifically, the `delay` argument must now be provided as a named argument (e.g., `delay=1s`).fixUpdate calls to `Login with Public Key` to use named arguments for `delay`.
affects: >= 3.0.0
breakingPrior to SSHLibrary 3.1.0, all non-empty strings, including 'no' and 'none', were considered `True` for boolean arguments. This behavior was aligned with Robot Framework 3.0.3, where 'none' is considered `False`.fixIf using string boolean arguments (e.g., 'True', 'False', 'yes', 'no'), ensure to upgrade to SSHLibrary 3.1.0 or newer for correct boolean evaluation, especially for 'no'/'none' values.
affects: < 3.1.0
gotchaConnections or command executions can hang or time out (e.g., 'SSHLibrary Exception: Timeout opening tunnel') due to insufficient default timeouts or network latency.fixExplicitly set timeouts. Use `Library SSHLibrary timeout=30s` during import, `Open Connection host=${HOST} timeout=1min`, `Login username=${USER} password=${PASS} delay=1s`, and `Execute Command command timeout=30s`. affects: All versions
gotchaThe `path_separator` argument (used by keywords like `Get File`, `Put Directory`) defaults to '/' (Unix-like). On Windows SSH servers, this may need to be explicitly set to '\\' (doubled backslash in Robot Framework data) if the server uses backslashes.fixConfigure the `path_separator` during library import or using `Set Default Configuration` or `Open Connection`: `Library SSHLibrary path_separator=\\\` or `Open Connection ${HOST} path_separator=\\\`. affects: All versions
Upgrade
Version history
3.8.0latest on PyPI · released Nov 18, 2021
Audit
Dependencies
paramikorequiredCore dependency for SSH communication in Python.
scprequiredCore dependency for SCP/SFTP file transfers in Python.
cryptographyrequiredRequired by Paramiko for cryptographic operations (or PyCrypto for older Paramiko versions).
robotbackgroundloggeroptionalRequired for creating SSH tunnels (version > 1.2).
Trilead SSH libraryrequiredRequired when using SSHLibrary with Jython.
win_inet_ptonoptionalRequired on Windows operating systems when using Python versions older than 3.0.