Linux ssh connection prompts The authenticity of how to remove?

  

Linux users use the ssh compiler script, the The authenticity of host can & rsquo; t be xx established prompt, although does not affect the ssh connection, but each connection Will appear, how to remove the prompt?

A while back, but do backup system recovery exercises found, rsync been a long time have not sync successful. Originally, the key exchange is used to complete the verification in ssh, but it may be prompted by the key of the host. Every time ssh connection (or rsync), there will be a prompt: The authenticity of host can’t be xx established Output an interaction of “yes”.

For this prompt, there is no prediction in the script, so there is no judgment and processing (it is easy to handle with expect). The following method is provided to remove the prompt.

1. When using ssh to connect to a remote host, add the option of “-o StrictHostKeyChecking=no” as follows:

ssh -o StrictHostKeyChecking=no 192.168.xxx.xxx

2. A way to completely remove this hint is to modify the configuration in the /etc/ssh/ssh_config file (or $HOME/.ssh/config) and add the following two lines:

StrictHostKeyChecking no< Br>

UserKnownHostsFile /dev/null

After modifying the configuration, restart the sshd service. The command is: /etc/init.d/sshd restart (or service sshd restart )
< Of course, this is the ssh connection between the servers that are trusted by the intranet, so the host key is checked directly without considering security issues.

The problem with “Host key verification failed.” encountered in ssh is also related to the configuration of "StrictHostKeyChecking".

The above is the way to remove the ssh connection when the Linux removes the ssh connection. The method of the prompt is introduced. If you think that the prompt has been annoying, you can choose to remove it.

Copyright © Windows knowledge All Rights Reserved