Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssh-copy-id no identities found error

Tags:

unix

ssh

ssh-keys

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 
like image 857
user3331975 Avatar asked Mar 20 '14 11:03

user3331975


People also ask

Why SSH-copy-ID does not work?

There are a number of reasons why the test might fail: The server might not be configured to accept public key authentication. Make sure /etc/ssh/sshd_config on the server contains PubkeyAuthentication yes . Remember to restart the sshd process on the server.

Where does SSH-copy-ID store keys?

This key gets passed from ssh to the cat command executed on a server. The >> operator redirects the STDOUT of the cat to the end of the ~/. ssh/authorized_keys file. This way the key from public keys is appended to the authorized_keys on the server.

What is SSH-copy-ID in Linux?

The ssh-copy-id command is a simple tool that allows you to install an SSH key on a remote server's authorized keys. This command facilitates SSH key login, which removes the need for a password for each login, thus ensuring a password-less, automatic login process.


1 Answers

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

like image 104
Josh Jolly Avatar answered Sep 21 '22 21:09

Josh Jolly