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

1 Generate public-private key pairs

[atguigu@hadoop102 .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 atguigu@hadoop102
The key's randomart image is:
+--[ DSA 1024]----+
|             ..  |
|              .E |
|  . o   . .    o.|
|   o o + o    *.o|
|    o = S   ...* |
|     + * . o ..  |
|      o   o      |
|                 |
|                 |
+-----------------+
[atguigu@hadoop102 .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 user@remote_ip

I tried it, and I solved it

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

  .ssh/authorized_keys

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

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

  .ssh/authorized_keys

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

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

 

Read More: