Ssh Public Key Problem: /Usr/Bin/Ssh-Copy-Id: Error: No Identities Found

Ssh Public Key Problem: /Usr/Bin/Ssh-Copy-Id: Error: No Identities Found

I have two users each with their own computers running Ubuntu. I want to remotely access one of them (say the desktop server) from the other one (say the client pc).
I'm trying to enable public key based authentication following the relative section in this answer (Connect two computers with SSH in a home LAN). I started with the command from the client pc

ssh-keygen -t rsa -b 4096

After setting the file in which to save the key and the passphrase I launch the following command:

ssh-copy-id 

where emanuele@emanuele-desktop is the user@comp of the desktop server to which I'd like to remotely access

/usr/bin/ssh-copy-id: ERROR: No identities found

Any idea of what I'm missing?

3

1 Answer

ssh-copy-id expects the user's public key file to be located in ~/.ssh - specifically:

 The default_ID_file is the most recent file that matches: ~/.ssh/id*.pub,
 (excluding those that match ~/.ssh/*-cert.pub) so if you create a key
 that is not the one you want ssh-copy-id to use, just use touch(1) on
 your preferred key's .pub file to reinstate it as the most recent.

Correspondingly, that's where ssh-keygen writes generated keys by default - if you chose a non-default file location when you ran ssh-keygen, then you can specify that to ssh-copy-id using the -i option:

 -i identity_file
         Use only the key(s) contained in identity_file (rather than look‐
         ing for identities via ssh-add(1) or in the default_ID_file).  If
         the filename does not end in .pub this is added.  If the filename
         is omitted, the default_ID_file is used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.