Fix - ssh-copy-id no identities found error


Error:
# sh-copy-id root@192.169.1.123
/usr/bin/ssh-copy-id: ERROR: No identities found
ssh-copy-id no identities found error
Solution:

Fix 1: You need to add an option -I followed by your pub key location.

Syntax:
ssh-copy-id [-i [identity_file]] [user@]machine
Example:
# ssh-copy-id -I my-key.pem admin-user@192.169.1.123

Note: The pem key should be at the ./ssh/keyname.pem or the user /home directory.

Fix 2: If you do not have the .pem key, you first need to generate it using ssh-keygen command,

# ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): mykey
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in mykey.
Your public key has been saved in mykey.pub.
The key fingerprint is:
SHA256:NLc+NeahlR1fi/MrQErjPDVjP3U412CGZ0UkzpUrDFY root@3fb331332832
The key's randomart image is:
+---[RSA 2048]----+
|            .E+=*|
|           o.+++.|
|        o o oo+++|
|       . = B =+==|
|        S S @o+oo|
|         * C =o  |
|          = o .. |
|           . .  .|
|              .. |
+----[SHA256]-----+
-


Have Questions? Post them here!

Topics Coverage:


🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram