API Reference

Paramiko

A pure-Python implementation of SSHv2 with client connections, key management, and SFTP.

Official Documentation ↗
CompatibilityThis documentation covers version v3.4. Check the official docs for the latest API surface.

Installation

pippip install paramiko

Methods

Paramiko implements the SSH protocol so Python can run remote commands and transfer files securely.

Key Features

  • SSH client and server support
  • Key-based and password authentication
  • SFTP client for file transfer

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

Security notes

Quoted verbatim from the official documentation; this is not a complete threat model. 来源:https://docs.paramiko.org/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:51:37.711Z.

  • As a client, you are responsible for authenticating using a password or private key, and checking the server’s host key. (https://docs.paramiko.org/)

FAQ

Should I use AutoAddPolicy?
Not in production. It trusts any host key, enabling man-in-the-middle attacks. Load known_hosts or pin the key.
Password or key auth?
Prefer keys. Passwords can be brute forced and are harder to rotate without a secret manager.
How do I transfer files?
Open an SFTP session with client.open_sftp() and use put, get, and listdir for transfers.