ssh-copy-id no identities found error

I have few client systems where I need to push the ssh key and login from my server without authentication prompts.

First, on the server, I created ssh key as below which was successful

]# ssh-keygen -t rsa -N "" -f my.key

Second, tried copying the pub key but fails with no identity error. Am i doing a wrong step here?

]# ssh-copy-id my.key.pub 10.10.1.1
/usr/bin/ssh-copy-id: ERROR: No identities found

You need to use the -i flag:

ssh-copy-id -i my.key.pub 10.10.1.1

From the man page:

If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file


Generating ssh keys on the client solved it for me

$ ssh-keygen -t rsa