2

Hello i have a laptop with ubuntu and a mac i have ssh-copy-id to mac succesfully but when i tried from Mac to ubuntu i got a warning. I set a new key but then when tried from Mac to ssh-copy-id to ubuntu i got this warning

The authenticity of host '192.168.x.xxx (192.168.x.xxx)' can't be established.
    ECDSA key fingerprint is -----------------------------------------.
    Are you sure you want to continue connecting (yes/no)?

So every time i am going to ssh-copy-id to any remote machine i am always going to get

The authenticity of host '192.168.x.xxx (192.168.x.xxx)' can't be established.
ECDSA key fingerprint is -----------------------------------------.
Are you sure you want to continue connecting (yes/no)?

the first time ?? Or am i doing something wrong?

Thank you in advance ~!

  • 1
    There is no need to hide your IP address. 192.168.x.x is a private IP address, no one can reach it unless they are in the network. – Timothy Pulliam Oct 9 '17 at 19:17
2

Yes, that is the default and expected behavior of ssh.

You get the warning every time you connect to a host that is not listed in your ~/.ssh/known_host.

If you write yes, the host and it's fingerprint will be added to known_hosts, if you choose no they won't.

In case you connect to the same ip/fqdn, but the fingerprint is not the same you will get an error and a prompt that advises you to remove the offending host from known_host to continue connecting.

The fingerprint will change only if the host or user are replaced/reinstalled.

This is configured in /etc/ssh/ssh_config by the flag:

StrictHostKeyChecking

So, it is normal that any ssh based tool will prompt you to add the host to known_hosts if you haven't connected with other ssh based tools before.

1

You will only get that message if

1) you are connecting to a machine for the first time. You get the message because the server you are connecting to has an unknown SSH public key (/etc/ssh/*.pub) that is not yet added to your known hosts file (~/.ssh/known_hosts)

2) if the public key mentioned above has changed on the server you are trying to connect to. Did you reimaged your Ubuntu system? Otherwise could be a man in the middle attack (unlikely if it is on your home network)

3) you will get that message if you connected to the host previously using it's IP address, but are now using it's hostname or DNS alias (or vice versa). This is because each entry in your ~/.ssh/known_hosts file has a separate entry for hostname and ip address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.