ssh: The authenticity of host 'hostname' can't be established

前端 未结 16 1154
时光取名叫无心
时光取名叫无心 2020-12-04 05:04

When i ssh to a machine, sometime i get this error warning and it prompts to say \"yes\" or \"no\". This cause some trouble when running from scripts that automatically ssh

16条回答
  •  时光说笑
    2020-12-04 05:45

    The following steps are used to authenticate yourself to the host

    1. Generate a ssh key. You will be asked to create a password for the key
    ssh-keygen -f ~/.ssh/id_ecdsa -t ecdsa -b 521
    

    (above uses the recommended encryption technique)

    1. Copy the key over to the remote host
    ssh-copy-id -i ~/.ssh/id_ecdsa user@host
    

    N.B the user @ host will be different to you. You will need to type in the password for this server, not the keys password.

    1. You can now login to the server securely and not get an error message.
    ssh user@host
    

    All source information is located here: ssh-keygen

提交回复
热议问题