ssh-copy-id tool on Windows
Submitted by itefix on Fri, 29/11/2024 - 15:01
Copssh client versions 8 and higher supports ssh-copy-id tool
- Create a test key pair
bin\ssh-keygen -t ed25519 -f test Generating public/private ed25519 key pair. Enter passphrase for "test" (empty for no passphrase): Enter same passphrase again: Your identification has been saved in test Your public key has been saved in test.pub
- Get help
bin\bash --login -c "ssh-copy-id -?"
Usage: /bin/ssh-copy-id [-h|-?|-f|-n|-s] [-i [identity_file]] [-p port] [-F alternative ssh_config file] [[-o <ssh -o options>] ...] [user@]hostname -f: force mode -- copy keys without trying to check if they are already installed -n: dry run -- no keys are actually copied -s: use sftp -- use sftp instead of executing remote-commands. Can be useful if the remote only allows sftp -h|-?: print this help
- Transfer the public key (dry mode)
bin\bash --login -c "ssh-copy-id -n -i ./test a@localhost"
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "./test.pub" /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys =-=-=-=-=-=-=-= Would have added the following key(s): ssh-ed25519 AAAA.....GG80e user@host =-=-=-=-=-=-=-=
- Transfer the public key
bin\bash --login -c "ssh-copy-id -i ./test a@localhost"
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "./test.pub" /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys a@localhost's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'a@localhost'" and check to make sure that only the key(s) you wanted were added.
- Transfer the same key once again!
bin\bash --login -c "ssh-copy-id -i ./test a@localhost"
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "./test.pub" /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system. (if you think this is a mistake, you may want to use -f option)
Featured product
Release Announcements
- 2024-11-25 Copssh client 8.0.0
- 2024-11-17 OpenSSL tool 2.0.1
- 2024-11-17 Wrbldnsd 5.0.2