A Windows-friendly replacement for the Linux ssh-copy-id tool.
Project description
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.gz
and.whl
files. - (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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sshcopyid-0.0.6.tar.gz
.
File metadata
- Download URL: sshcopyid-0.0.6.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77001aa42dd2c248567785fe83edd6efd2803e019f0596ed8fa0c05d5b5f9f78 |
|
MD5 | 9a70df73483c3ca52c2a02ebcebced79 |
|
BLAKE2b-256 | f0c1e27b849f7ff6924353cd300f8db67492de0c0330a56f511237c01a10999b |
File details
Details for the file sshcopyid-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: sshcopyid-0.0.6-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0820fc83890bb9f9a7dc64d09f73f2e5631aa89023810995deb33379093373cd |
|
MD5 | 97949f6381881e4f7566b40cd75505f2 |
|
BLAKE2b-256 | 016e6a070331f780c7b73e0717ca7a51ad12d6a1bafaa67fb51ab3de05c50f30 |