Skip to main content

simple_ssh_copy

Transfer files to and from small or old POSIX-like devices over SSH.

This package intentionally avoids SFTP/SCP subsystems. It only needs a working SSH login and a few basic POSIX shell commands, so it is useful for minimal Linux systems, embedded devices, rescue environments, and older SSH servers.

Features

  • Upload a local file to a remote host.
  • Download a remote file to the local machine.
  • Download a remote directory recursively.
  • Aborts with a yellow warning when the remote system is detected as Windows.
  • Prints the remote architecture detected with uname -m before transfers.
  • Password, empty-password, SSH agent, ~/.ssh key, and explicit private-key authentication.
  • Broad SSH algorithm compatibility enabled by default. During Paramiko transport setup, the client allows every currently supported key exchange, cipher, MAC/digest, server host key, and public-key signature algorithm that can be used by the active Paramiko transport.

For implementation notes, transfer flow, block sizes, and compatibility details, see Technical Details.

Install

pip install simple_ssh_copy

For local development:

pip install -e .

Command Line

Upload a file:

python -m simple_ssh_copy ./test-file.txt root@192.168.1.10:/home/root/test-file.txt

Download a file:

python -m simple_ssh_copy root@192.168.1.10:/home/root/test-file.txt ./test-file.txt

Use a non-default port:

python -m simple_ssh_copy ./test-file.txt root@192.168.1.10:2222:/home/root/test-file.txt

Use an explicit private key:

python -m simple_ssh_copy -i ~/.ssh/id_rsa ./test-file.txt root@192.168.1.10:/home/root/test-file.txt

On Windows:

python -m simple_ssh_copy -i C:\Users\neko\.ssh\id_rsa .\test-file.txt root@169.254.115.127:/home/root/test-file.txt

Increase the SSH timeout:

python -m simple_ssh_copy --timeout 60 ./test-file.txt root@192.168.1.10:/home/root/test-file.txt

When prompted for a password, press Enter for empty-password or key-only login. In that case the client also tries SSH agent and keys discoverable in ~/.ssh.

Python API

import simple_ssh_copy

hostname = "192.168.1.10"
username = "root"
password = ""

simple_ssh_copy.upload(
    hostname=hostname,
    username=username,
    password=password,
    files=[("./test-file.txt", "/home/root/test-file.txt")],
    key_filename="~/.ssh/id_rsa",
)

simple_ssh_copy.download(
    hostname=hostname,
    username=username,
    password=password,
    files=[("/home/root/test-file.txt", "./test-file.txt")],
    key_filename="~/.ssh/id_rsa",
)

simple_ssh_copy.download_dir(
    hostname=hostname,
    username=username,
    password=password,
    remote_dir="/home/root/logs",
    local_dir="./logs",
    key_filename="~/.ssh/id_rsa",
)

Run a remote command with the low-level client:

from simple_ssh_copy import SimpleSSHClient

with SimpleSSHClient(
    hostname="192.168.1.10",
    username="root",
    password="",
    key_filename="~/.ssh/id_rsa",
) as ssh:
    code, stdout, stderr = ssh.exec_cmd("uname -a")

SSH Algorithm Compatibility

Some old devices require options like:

ssh -o HostKeyAlgorithms=+ssh-rsa \
    -o MACs=+hmac-sha1-96,hmac-sha1,hmac-md5 \
    -i ~/.ssh/id_rsa root@192.168.1.10

simple_ssh_copy enables a broader Paramiko-side compatibility mode by default. It advertises all key exchange, cipher, MAC/digest, server host key, and public-key signature algorithms registered by the active Paramiko transport, while preserving Paramiko's default preference order first. It also restores ssh-rsa host keys and RSA public-key signatures when Paramiko can use them.

The matching file-transfer command is usually:

python -m simple_ssh_copy -i ~/.ssh/id_rsa ./file root@192.168.1.10:/tmp/file

If you need stricter modern SSH behavior, pass allow_ssh_rsa_host_key=False from the Python API. The parameter name is kept for API compatibility, but disabling it skips the broader compatibility transport setup.

Path Format

Remote paths use one of these formats:

user@host:/remote/path
user@host:port:/remote/path

Only local-to-remote and remote-to-local transfers are supported. Remote-to- remote transfers are not supported.

Limitations

  • The remote host must provide a POSIX-like shell.
  • Non-POSIX SSH servers, such as Windows command-shell SSH sessions, are not supported. Windows remotes are detected after SSH connection setup and abort with a yellow warning before file operations begin.
  • Transfer startup reports the remote architecture with uname -m.
  • Upload uses mkdir and base64 on the remote host.
  • Upload sends base64 fragments through bounded remote commands, then decodes the assembled temporary file on the remote host.
  • Download uses stat, dd, and find for directory downloads.
  • Directory upload is not implemented.
  • Very large uploads may be slower than real SCP/SFTP because data is written through remote shell commands.

Metadata

Release files for simple-ssh-copy 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-ssh-copy 0.1.14
File Size Uploaded
simple_ssh_copy-0.1.14.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-ssh-copy 0.1.14
File Interpreter ABI Platform
simple_ssh_copy-0.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / simple_ssh_copy-0.1.14.tar.gz

Download URL simple_ssh_copy-0.1.14.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3e42c0713feca718ee83240a5658f81a69a85457661f26940b3857d14ade837e
BLAKE2b-256 checksum
How to use checksums
d17c531795abb1d967cd3348d68343e200c81dcaa4f52e82d56b143212365fea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Release files / simple_ssh_copy-0.1.14-py3-none-any.whl

Download URL simple_ssh_copy-0.1.14-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99f8f57136ad9ad6001ec46c09539410c7305d0ec54ecb10ea58fb152895eae6
BLAKE2b-256 checksum
How to use checksums
fb1abcb2fb3ef14d9ac56cfca1fc75abc1d320eba8dee72adfeb76b5b0b2206e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page