mock-ssh-server
Mock SSH server for testing purposes
Decision gist · record as of 2026-08-14
Yes, if you need to test SSH or SFTP client code. The package has low install friction, is actively maintained, and carries no known vulnerabilities. The main caveat is that the latest release was 2021-09-13, so verify compatibility with your Python version and current paramiko versions before committing to it in a new project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only paramiko and selectors2 as runtime dependencies.
- Actively maintained, with last commit on 2026-05-27.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) — you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
last release 2021-09-13 (1796 days) · last repo commit 2026-05-27 · 57 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 229,879 downloads/mo, #9,120 on PyPI
Alternatives
Verify before relying
pip install mock-ssh-server
import mock_ssh_server
users = {"testuser": "/path/to/key"}
with mock_ssh_server.Server(users) as server:
with server.client("testuser") as client:
_, stdout, _ = client.exec_command("ls /")
print(stdout.read())- Whether the package works reliably with Python versions beyond 3.9 (classifiers list only through 3.9).
- Current test coverage and whether all SSH/SFTP operations are fully supported for modern use cases.
- Compatibility with current versions of paramiko and selectors2.
What it is and what it does
mock-ssh-server is a testing utility that spins up a lightweight SSH server in Python without needing OpenSSH installed. It wraps paramiko to provide a context manager you can use in test fixtures, letting you run real SSH and SFTP commands against a controlled server during unit or integration tests. You supply a dictionary of test users and their private key paths, then connect to the server using paramiko's client API just as you would to a real SSH host.
The package is designed for developers who need to test SSH-based tools, scripts, or libraries in isolation. Instead of mocking SSH calls or relying on external SSH infrastructure, you get a real SSH server running in your test process that you can tear down cleanly after each test.
Use it for
- Test SSH client code by connecting to a mock server in a pytest fixture without external SSH setup.
- Verify SFTP file transfer logic by uploading and downloading files to a test server running in the same process.
- Integration test SSH-based deployment or configuration management tools in CI/CD pipelines.
- Validate SSH command execution and output parsing in tools that shell out over SSH.
- Test multi-user SSH scenarios by configuring multiple test users with different keys in a single server instance.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to test SSH or SFTP client code.
The package has low install friction, is actively maintained, and carries no known vulnerabilities. The main caveat is that the latest release was 2021-09-13, so verify compatibility with your Python version and current paramiko versions before committing to it in a new project.
Install
mock-ssh-server on PyPI
Before you install
Low friction: pure Python wheel with only paramiko and selectors2 as runtime dependencies. Actively maintained, with last commit on 2026-05-27.
License in practice
MIT license (permissive) — you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install mock-ssh-server
import mock_ssh_server
users = {"testuser": "/path/to/key"}
with mock_ssh_server.Server(users) as server:
with server.client("testuser") as client:
_, stdout, _ = client.exec_command("ls /")
print(stdout.read())
Verify before relying
- Whether the package works reliably with Python versions beyond 3.9 (classifiers list only through 3.9).
- Current test coverage and whether all SSH/SFTP operations are fully supported for modern use cases.
- Compatibility with current versions of paramiko and selectors2.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesparamikoselectors2 |
| Maintenance | Actively maintained 1,796 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 229,879 / month, #9,120 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing |
Evidence: mock_ssh_server-0.9.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ssh server testing”
- mock-ssh-serverProvides a Python context manager that runs an in-process SSH server…
- paramikoParamiko is a pure-Python SSH protocol library providing both client…
- robotframework-sshlibraryA Robot Framework test library for executing commands, transferring…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also paramiko · mocksftp · sftpserver · pytest-sftpserver · fs.sshfs · sftpretty · proxmoxer · paramiko-expect · pysftp · sshuttle