Usually in the past I've always manually copied over my SSH public key to the remotes where necessary. I'm on a Mac and I finally decided to start using ssh-copy-id to make my life simpler, so I just used homebrew to install it.
I just used ssh-copy-id for the first time and am little confused by the result.
On my local machine, when viewing my id_rsa.pub key, it ends with username@machinename. I love this and it's made it easy to identify keys I can delete on remote machines later on.
I just used ssh-copy-id on my local machine to move my public key to a remote and then took a look at the authorized_keys file on the remote. I noticed that on the remote instead of my public key ending with myusername@mymachinename (as expected) it now ends with /Users/myusername/.ssh/id_rsa ??
Why the discrepancy? Is there any way to force ssh-copy-id to use username@machinename like it does on my local machine?
This might just be a misunderstanding I have with SSH and keys in general, but any thoughts are appreciated?
EDIT:
Just discovered that this only happens when I exclude my identity file and assume defaults.
Basically if I only do: ssh-copy-id user@hostname then I get this awkward comment in the authorized_keys file on the remote.
If I specify my public key: ssh-copy-id -i ~/.ssh/id_rsa.pub user@hostname then everything copies over as expected, using myusername@machinename as expected ?!
What's causing this oddity? The following link says that it should always default to using my id_rsa.pub file anyway, so I shouldn't need to specify it to get the right comment on the remote should I? http://linux.die.net/man/1/ssh-copy-id