--- id: mock-ssh-server version: "0.9.1" license: MIT license_treatment: permissive maintenance: active --- # mock-ssh-server — Mock SSH server for testing purposes License: permissive · Maintenance: active · Downloads: 229.9K/mo ## 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 above — verify before relying. Provides a Python context manager that runs an in-process SSH server for testing, built on paramiko, without requiring OpenSSH binaries. 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 pip install mock-ssh-server uv add mock-ssh-server poetry add mock-ssh-server ## Installing mock-ssh-server 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: unspecified - Install friction: low - Maintenance: active - Downloads: 229.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ssh server testing, mock ssh server, ssh testing fixture, paramiko test server, ssh client testing, sftp testing, ssh integration tests, ssh-testing, pytest-fixture, sftp [View on SkillFed](https://skillfed.io/packages/mock-ssh-server) · [View on PyPI](https://pypi.org/project/mock-ssh-server/)