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

1 Generate public-private key pairs

[[email protected] .ssh]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/atguigu/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/atguigu/.ssh/id_dsa.
Your public key has been saved in /home/atguigu/.ssh/id_dsa.pub.
The key fingerprint is:
25:0a:23:7f:a7:f0:d1:78:f6:59:57:e3:cc:78:49:d0 [email protected]
The key's randomart image is:
+--[ DSA 1024]----+
|             ..  |
|              .E |
|  . o   . .    o.|
|   o o + o    *.o|
|    o = S   ...* |
|     + * . o ..  |
|      o   o      |
|                 |
|                 |
+-----------------+
[[email protected] .ssh]$ ssh-copy-id hadoop103
/usr/bin/ssh-copy-id: ERROR: No identities found

After regenerating the key pair, it was copied to another machine, HadoOP103 times made the following mistake:

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

The reason mentioned online is that no key pair has been generated.
Obviously, I am not the reason, as mentioned below:
Then it is found that the public key path is missing and can be added through -i:

$ ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]_ip

I tried it, and I solved it

[[email protected] .ssh]$ ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]
[email protected]'s password: 
Now try logging into the machine, with "ssh '[email protected]'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[[email protected] .ssh]$ ssh-copy-id -i ~/.ssh/id_dsa.pub [email protected]
[email protected]'s password: 
Now try logging into the machine, with "ssh '[email protected]'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[[email protected] .ssh]$ ssh hadoop104
Last login: Fri Dec 28 03:39:18 2018 from 192.168.31.1
[[email protected] ~]$ exit
logout
Connection to hadoop104 closed.
[[email protected] .ssh]$ ssh hadoop103
Last login: Fri Dec 28 03:39:18 2018 from 192.168.31.1
[[email protected] ~]$ exit
logout
Connection to hadoop103 closed.

 

Read More: