Welcome to the Linux Foundation Forum!

Lab 5.1 - Copy the public key with ssh-copy-id

Elyas Posts: 28
edited December 2016 in LFS211 Class Forum

I am doing the Lab 5.1 and I try to issue the command 

ssh-copy-id elyasin@localhost

I see the message The authenticity of host 'localhost(::1)' can't be established.

Can anyone explain to me what that this message means? Is it expected to appear? What would be the solution?


  • saqman2060
    saqman2060 Posts: 777
    edited January 2017

    It appears by this command, you are trying to copy your localhost's key back to itself. 

    The command "ssh-copy-id" allows you to copy an ssh public key to another machine. What you are doing above is the complete opposite. Your localhost already has the public key. I belive you are confusing your system as to what machine you are trying to copy the public key to. 

    Try that same command but direct it to another computer on your network, not that one you are on.



  • lee42x
    lee42x Posts: 380
    edited January 2017

    The ssh protocol uses a public key to encrypt the information between two hosts. During the startup phase the server sends its public key over to the client to use for encryptyion. This key can be verified manually and after the client has confirmed the key is good it is stored locally on the client in $HOME/.ssh/known_hosts for future reference.What the prompt is telling you is " I the client have recieved a public key from systemX that is not previously known to me. Do you, the human, wish to accept this key? Here is the key fingerprint for your checking convienience."  If the answer is "yes" the public key is stored in the known_hosts file. There is an option to disable this checking if desired. 

    For more information, check the man page for ssh, under the section VERIFYING HOST KEYS. 


Upcoming Training