升級了openssh後遠端的服務器無法通過sftp傳輸文件到高服務器,後來發現是遠端的服務器ssh版本太低,而新升級了openssh的服務器已經不再支持老版本ssh client的相關協議,這時候有兩種解決辦法,一種是升級遠端服務器的openssh client版本,一種是修改升級後的服務器配置文件使其支持舊版本的協議,我這裏採用了第二種方式。
系統 centos 7
查看支持的協議
sshd -T | grep kex
kexalgorithms curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
修改配置文件爲如下所示:
vi /etc/ssh/sshd_config
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]
重啓sshd服務