Skip to content

Fix: /usr/bin/ssh-copy-id: error: no identities found

  • by
  • 2 min read

SSH or Secure Shell is a protocol that allows anyone to access a remote client via the terminal. The protocol is very important and makes a lot of remote work possible right in the terminal. However, while it’s quite easy to set up, it can also be problematic at times. 

In this article, we’re talking about the “/usr/bin/shh-copy-id: error: no identities found” issue, its causes and what you can do to fix the problem.

Also read: Fix: pty allocation request failed on channel 0


What causes the “/usr/bin/shh-copy-id: error: no identities found” issue?

The issue occurs because the ssh-copy-id command expects the user’s public key file to be located in teh ~/.ssh folder. If your generated key isn’t present in this directory or you haven’t generated an SSH key yet, you’ll see this error. Another possible reason for the error is the absence of any generated public keys at all, which can be remedied by running the ssh-keygen command, which will generate the required keys in the default location resolving the error. 

Top 7 IDEs and Text Editors to code Python, Java, C++, HTML and more

How to fix the “/usr/bin/shh-copy-id: error: no identities found” issue?

The issue is simple. We’re going to use the -i flag to specify a non-default location where the ssh-keygen tool has generated and stored the public keys required to securely connect to the remote client. 

You can do this by running the following command.

ssh-copy-id -i [location of public key] 123.456.789.111

Make sure to add the location of the public key and specify the correct server IP address when running the aforementioned command. If this doesn’t solve your problem, try generating SSH keys on your client first using this command. 

ssh-keygen -t rsa

The aforementioned command will generate the required SSH keys in the default directory eliminating the need for specifying the public key explicitly using the -i flag. 

Also read: How to fix ‘SSH too many authentication failures’ error?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>