SSH,scp,sftp的客户端和服务器端都支持各种加密算法,虽然最终确定权是服务器端,但必须是客户端提供列表中,第一个服务器端也支持的算法。因此客户端需要将最期望用的算法放在前面。
目录导航
参考
https://ubuntu.com/server/docs/explanation/crypto/openssh-crypto-configuration/
https://www.rfc-editor.org/rfc/rfc4253
OPENSSH相关内容

The first algorithm in the list (that the client offers to the server) that matches an offer from the server, is what will be selected.
服务器算法列表中,第一个与客户端提供给服务器的算法列表匹配的被选中。
RFC 4253

The first algorithm on the client's name-list that satisfies the requirements and is also supported by the server MUST be chosen.
客户端算法列表里,第一个服务端也支持的,【必须】被选中。
总结
从这2个标准可以看到,客户端提供算法列表中,如果服务器也支持,则靠前的被选中。
客户端: A,B,C,D,E
服务器:B,C,D,E,A
最终命中:A
因为A在客户端列表里的第一个,同时也是服务器端支持的。所以客户端如果对某个或某些算法有更高期望,则要把该算法放在前面。