Fix - ssh-copy-id no identities found error

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

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

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

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
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 .. |
|           . .  .|
|              .. |

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap