解決辦法1:在用戶配置目錄下添加一個ssh配置文件
vim /root/.ssh/config 內容如下:
Host *
KexAlgorithms +diffie-hellman-group1-sha1
解決方法2: 在ssh全局配置目錄下添加一個ssh配置文件
vim /etc/ssh/ssh_config.d/ssh_xx.conf 內容如下:
Host *
KexAlgorithms +diffie-hellman-group1-sha1
特別注意:
~/.ssh/config文件的權限,不能設置為777, 否則仍會報上述錯誤,設置為660是OK的。