Skip to main content

ssh-copy-id

A Windows-friendly replication of the Linux ssh-copy-id CLI.

About

On Linux, ssh-copy-id is a convenient command for installing your public key on a remote machine. This tool fills that gap on Windows. It's not as extensive as the original Linux command, but it uses a very similar syntax and is sufficient for most basic use cases.

Prerequisites

  • Windows (Windows 7/8/10/11) with:
    • Python 3.6+ installed
    • OpenSSH client (either installed via Windows Features on Windows 10+ or other methods like Git for Windows)
    • PowerShell (typically included on Windows 7+; if not, install it)

Installation

pip install sshcopyid

This installs the command-line tool ssh-copy-id into your Python scripts directory (often at C:\Users\<USERNAME>\AppData\Local\Programs\Python\PythonXX\Scripts\ on Windows).

Usage

usage: ssh-copy-id [-h] [-p PORT] [-i PUB_KEY_PATH] target

Copy the current user's SSH public key to a remote machine.
(This CLI is intended for use under Windows only.)

positional arguments:
  target                username@host (The username and hostname/IP of the remote host)

optional arguments:
  -h, --help            Show help message and exit
  -p PORT, --port PORT  The SSH port number of the remote machine (default: 22)
  -i PUB_KEY_PATH, --identity-file PUB_KEY_PATH
                        Path to the public key file to copy (default: %USERPROFILE%\.ssh\id_rsa.pub)

Example

# Copy your default key to a remote host on port 22
ssh-copy-id myuser@192.168.1.100

# Specify a custom port (e.g., 2200)
ssh-copy-id -p 2200 myuser@192.168.1.100

# Specify a custom public key file
ssh-copy-id -i C:\Users\myuser\.ssh\id_ed25519.pub myuser@myserver.com

When it succeeds, you'll be able to SSH into the remote host without entering your password, just like the original ssh-copy-id.

Contributing

  1. Fork the project and clone locally.
  2. Create a new branch for your work.
  3. Commit and push to your repository.
  4. Create a pull request in GitHub.

Improvements and PRs are always welcome!

How to Build and Publish a New Version (for maintainers)

  1. Update the version number in setup.py (e.g., version='0.0.7').
  2. Ensure you have the necessary tools installed:
    pip install setuptools wheel twine
    
  3. Build your distribution:
    # From the top-level project directory (where setup.py is located):
    python setup.py sdist bdist_wheel
    
    This command creates a dist/ folder containing .tar.gz and .whl files.
  4. (Optional) Test your package on TestPyPI:
    twine upload --repository-url https://test.pypi.org/legacy/ dist/*
    
    Then install from TestPyPI to verify everything works:
    pip install --index-url https://test.pypi.org/simple/ sshcopyid
    
  5. Upload to the real PyPI:
    twine upload dist/*
    
  6. Confirm installation from PyPI:
    pip install --upgrade sshcopyid
    

That’s it! The new version is now available on PyPI. Users can pip install sshcopyid and get your latest fixes and features.

Metadata

Release files for sshcopyid 0.0.6

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

Source distribution (sdist)

Source distribution for sshcopyid 0.0.6
File Size Uploaded
sshcopyid-0.0.6.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sshcopyid 0.0.6
File Interpreter ABI Platform
sshcopyid-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / sshcopyid-0.0.6.tar.gz

Download URL sshcopyid-0.0.6.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
77001aa42dd2c248567785fe83edd6efd2803e019f0596ed8fa0c05d5b5f9f78
BLAKE2b-256 checksum
How to use checksums
f0c1e27b849f7ff6924353cd300f8db67492de0c0330a56f511237c01a10999b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release files / sshcopyid-0.0.6-py3-none-any.whl

Download URL sshcopyid-0.0.6-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0820fc83890bb9f9a7dc64d09f73f2e5631aa89023810995deb33379093373cd
BLAKE2b-256 checksum
How to use checksums
016e6a070331f780c7b73e0717ca7a51ad12d6a1bafaa67fb51ab3de05c50f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

1 release file

0.0.4

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

2 release files

0.0.0

1 release file

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