Skip to main content

Windows ssh-copy-id utility.

Project description

dt-ssh-copy-id

Command-line windows tool that loosely mimics the *nix ssh-copy-id command.

Purpose

ssh-copy-id installs (one or more) SSH keys on a target server as an authorized key. Its purpose is to provide access without requiring a password for each login.

This provides the ability to enable automated (passwordless) logins using the SSH protocol.

Features:

  • Command line driven (loosely mimics the *nix syntax)
  • Multiple target hosts can be setup via single run
  • Identifies if keys are already present on target host(s).

Pre-requisites

  • Python 3.10+ (may work with earlier version, not tested)
  • fabric - layer over paramiko
  • paramiko - facilitates SSH interactions with target servers
  • loguru - manages logging

Setup

To install as a CLI (no source)

  • pipx install dt-ssh-copy-id (creates a virtual environment)

or

  • pip install dt-ssh-copy-id [--user]

To install source code

If you use Poetry, a virtual environment will be created with the required dependencies.

  • poetry install

else, you may install manually with -

  • pip install fabric loguru

Syntax

usage: ssh-copy-id [-h] [-f] [-i FILE] [-p PORT] hostname [hostname ...]

ssh-copy-id - copy ssh public keys to target host

positional arguments:
  hostname              [user@]hostname

options:
  -h, --help            show this help message and exit
  -f, --force           Force copy, no existence check.
  -i FILE, --identity_file FILE
                        the identity file to be copied. If not specified, adds all keys.
  -p PORT, --port PORT  SSH port (default 22)

Examples

  • Install all public keys for user tom onto server1

    > ssh-copy-id tom@server1

  • Install ONLY the rsa public key for user tom onto server1,2,3 and 4

    > ssh-copy-id -i ~/.ssh/id_rsa.pub tom@server1 tom@server2 tom@server3 tom@server4

  • Install all public keys for configured (.ssh/config) user onto server 'rasberrypi'

    > ssh-copy-id raspberypi


NOTE:

  • If you have a .ssh/config setup with defaults, those will be used (i.e. pre-defined usernames).
  • You will be prompted for a password upon first login.
    • That password will be re-used for each server
    • If login fails for a server, you will be re-prompted to supply a valid password.

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

dt_ssh_copy_id-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dt_ssh_copy_id-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file dt_ssh_copy_id-0.1.0.tar.gz.

File metadata

  • Download URL: dt_ssh_copy_id-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.9 Windows/10

File hashes

Hashes for dt_ssh_copy_id-0.1.0.tar.gz
Algorithm Hash digest
SHA256 da2ee02b353a99d7f37e1ce033a93b30c2562572ffa0fa40a56a915eaa2e9c80
MD5 b01051cafbb4cd44f97a405694162312
BLAKE2b-256 c4a77edcb1fb8f288e91be19a3b109df470554b17191c0985a9a10ec021446ef

See more details on using hashes here.

File details

Details for the file dt_ssh_copy_id-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dt_ssh_copy_id-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.9 Windows/10

File hashes

Hashes for dt_ssh_copy_id-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f05e568713f9bae27644743ff2e321ef699eb74763a0ef809ad8d471147eccc4
MD5 773efce6cf57977ff5e2f6aa43ec433f
BLAKE2b-256 9f7074621ccb7c98cd060b15f6e67e62ddc9e6ed8f62a846ba3fd36a3f2f4701

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page