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
- Fork the project and clone locally.
- Create a new branch for your work.
- Commit and push to your repository.
- Create a pull request in GitHub.
Improvements and PRs are always welcome!
How to Build and Publish a New Version (for maintainers)
- Update the version number in
setup.py(e.g.,version='0.0.7'). - Ensure you have the necessary tools installed:
pip install setuptools wheel twine
- Build your distribution:
# From the top-level project directory (where setup.py is located): python setup.py sdist bdist_wheel
This command creates adist/folder containing.tar.gzand.whlfiles. - (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
- Upload to the real PyPI:
twine upload dist/*
- 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)
| File | Size | Uploaded | |
|---|---|---|---|
| sshcopyid-0.0.6.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|