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

前端 未结 16 1155
时光取名叫无心
时光取名叫无心 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:44

    This warning is issued due the security features, do not disable this feature.

    It's just displayed once.

    If it still appears after second connection, the problem is probably in writing to the known_hosts file. In this case you'll also get the following message:

    Failed to add the host to the list of known hosts 
    

    You may fix it by changing owner of changing the permissions of the file to be writable by your user.

    sudo chown -v $USER ~/.ssh/known_hosts
    

提交回复
热议问题