Skip to content
Nicolas Couture edited this page Apr 19, 2026 · 1 revision

Troubleshooting & FAQ

Common Connection Issues

"couldn't match all kex parts"

This typically means your SSH client and the mock server cannot agree on a Key Exchange (KEX) or host key algorithm.

  • Solution: Ensure you are using a modern SSH client. MockSSH v2.0+ supports ssh-ed25519 and ecdsa. Avoid trying to force ssh-rsa unless you have enabled it on the client side.

Authentication Failed

MockSSH uses twisted.cred for authentication.

  • Solution: Double-check the users dictionary passed to runServer. Ensure the password matches exactly (it is case-sensitive).

Twisted Reactor Errors

"ReactorNotRestartable"

This error occurs if you try to call reactor.run() or startThreadedServer() after the reactor has already been stopped.

  • Solution: In test suites, manage the reactor at the session level (using a pytest session fixture). Start it once and stop it only after all tests complete. Use stopThreadedServer(server_port) to stop individual listeners instead of the reactor.

Port Conflicts

"Address already in use"

  • Solution: Ensure no other process (or a previous leaked test run) is listening on the target port. Use pkill -f MockSSH or ss -tulpn | grep <port> to find and stop lingering processes.

Clone this wiki locally