9

ssh 新机器去掉提示yes/no

 3 years ago
source link: http://abcdxyzk.github.io/blog/2021/06/01/ssh-login/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ssh 新机器去掉提示yes/no

2021-06-01 13:55:00

https://blog.csdn.net/wang1144/article/details/51731059

每次ssh 进入一台新机器都会跳出如下的提示:

The authenticity of host '111.222.333.444 (111.222.333.444)' can't be established.
RSA key fingerprint is f3:cf:58:ae:71:0b:c8:04:6f:34:a3:b2:e4:1e:0c:8b.
Are you sure you want to continue connecting (yes/no)? 
  1. 加入一个参数:
ssh -o "StrictHostKeyChecking no" user@host

2.修改配置文件

在文件/etc/ssh/ssh_config(全局)或者~/.ssh/config(某用户)开头加入以下内容:

Host 192.168.0.*
	StrictHostKeyChecking no
	UserKnownHostsFile=/dev/null
or

Host *
	StrictHostKeyChecking no
	UserKnownHostsFile=/dev/null

Posted by kk

2021-06-01 13:55:00tools, ssh

« Ubuntu 搭建OpenVPN服务器以及客户端的使用 ssh使用密钥登录,禁止口令登录 »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK