netscrew.dev/commands/ssh-copy-id
Command

n ssh-copy-id

Install your SSH key on a host for passwordless login (works on Windows too)

Short forms:copy-id · ssh-copy · pushkey · authkey

Usage — n ssh-copy-id

═══════════════════════════════════════════════════════════════════════════════
  Netscrew ("n") — ssh-copy-id (copy-id, ssh-copy, pushkey) — Install your SSH key on a host for passwordless login
═══════════════════════════════════════════════════════════════════════════════

USAGE:
  n ssh-copy-id <host>                 push your key (current user)
  n ssh-copy-id user@host              for a specific user

OPTIONS:
  --win                            target is a Windows OpenSSH server

Target: . = this machine · <host> = remote
Deeper: n ssh-copy-id -h = the concept/theory behind this command  ·  n -h ssh-windows

The concept behind it — n ssh-copy-id -h

═══════════════════════════════════════════════════════════════════════════════
  Netscrew ("n") — Install SSH Key for Passwordless Login
═══════════════════════════════════════════════════════════════════════════════

USAGE:
  n ssh-copy-id <host>         Install your SSH public key on <host>
  n ssh-copy-id user@host      Install for a specific remote user
  n ssh-copy-id <host> --win   Force the Windows-server procedure

WHAT IT DOES:
  • Finds your public key (~/.ssh/id_ed25519.pub, id_ecdsa.pub or id_rsa.pub), or offers
    to generate an ed25519 key if you have none.
  • Asks for the host's password once, then adds your key to the remote host (only if
    it isn't already there — matched on key material, so a different comment won't duplicate it).
  • Verifies that passwordless SSH now works.

  Like the classic ssh-copy-id, but it also works on Windows, which ships the OpenSSH
  client but no ssh-copy-id script — in both directions:

  • To Linux/macOS/BSD: appends to ~/.ssh/authorized_keys.
  • To Windows: writes to the correct file — administrators_authorized_keys for admin
    accounts, else the per-user file — and repairs the ACLs sshd requires (icacls). The remote
    OS is auto-detected when a key already works; otherwise pass --win for a Windows target.

EXAMPLES:
  n ssh-copy-id hp2            # passwordless login to hp2 as the current user
  n ssh-copy-id boss@hp2       # ... as user 'boss'
  n ssh-copy-id win-pc --win   # push to a Windows machine running OpenSSH Server

Back to main help: n -h | Windows SSH gotchas (key files & UAC elevation): n -h ssh-windows