cmdxray / commands / ssh-copy-id

What does ssh-copy-id do?

install your public SSH key into a remote host's authorized_keys.

▸ Explain your own ssh-copy-id command →

ssh-copy-id examples, explained

$ ssh-copy-id user@host

  • ssh-copy-idinstall your public SSH key into a remote host's authorized_keys
  • user@hostan argument passed to the command

$ ssh-copy-id -i ~/.ssh/id_ed25519.pub -p 2222 user@host

  • ssh-copy-idinstall your public SSH key into a remote host's authorized_keys
  • -iuse this identity (public key) file
  • ~/.ssh/id_ed25519.pubvalue for -i
  • -pconnect to this port on the remote host
  • 2222value for -p
  • user@hostan argument passed to the command

ssh-copy-id flags & options

-iuse this identity (public key) file
-pconnect to this port on the remote host
-opass this option through to ssh
-fforce — copy the key even if it appears to be installed already
-ndry run — show which keys would be installed, but don't

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.