The ssh-copy-id
was very useful for sending public keys to server. But it fail if you haven't private key file, now.
$ ssh-copy-id -i my_friend_rsa.pub root@example.com
/usr/bin/ssh-copy-id: ERROR: failed to open ID file 'my_friend_rsa': No such file
I don't understand this behaviour.
There are two cases for me:
- I send my own public key
- I send colleague's public key.
The first case is rare. The server has my public key already if I can connect to it. So I don't need the ssh-copy-id
in this case.
The second case is very often. I grant access to other user. But I have not his nor her private key. So this behaviour makes the ssh-copy-id useless in second case.
Please, explain me why ssh-copy-id
requires private key file?