最近买了个阿里云服务器,系统是Centos 7.6,在搭建环境的时候,需要将一些文件传输到服务器上,这个时候就想到使用SSH Secure File transfer 这个工具进行传输了,但是在输入服务器IP地址进行连接的时候,出现了报错“server responded algorithm negotiation failed ”,网上查了下知道了问题出在哪里了。
就是在Centos中ssh配置出现了问题,但是按照网上的攻略做了很多尝试,没有一个定位到点上了,后面终于自己一步步找到了问题点。这里记录下:
1.重新安装ssh,确保ssh已经安装
#yum install -y openssl openssh-server
2.修改配置文件/etc/ssh/sshd_config
# Vim /etc/ssh/sshd_config
直接跳到文件末尾,将Ciphers开头的代码注释掉,并添加如下代码。
#Ciphers aes128-ctr,aes192-ctr,aes256-ctr
UseDNS no
AddressFamily inet
SyslogFacility AUTHPRIV
PermitRootLogin yes
PasswordAuthentication yes
3.保存,退出,重启ssh服务
# systemctl restart sshd.service