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
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With