sed -i "/^MACs.*/d" /etc/ssh/sshd_config
echo "MACs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512" >> /etc/ssh/sshd_config
sed -i "/^KexAlgorithms.*/d" /etc/ssh/sshd_config
echo "KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,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" >> /etc/ssh/sshd_config
sed -i "/^PubkeyAcceptedKeyTypes.*/d" /etc/ssh/sshd_config
echo "PubkeyAcceptedKeyTypes rsa-sha2-512,rsa-sha2-256,ssh-ed25519" >> /etc/ssh/sshd_config
sed -i "/^HostKeyAlgorithms.*/d" /etc/ssh/sshd_config
echo "HostKeyAlgorithms rsa-sha2-512,rsa-sha2-256,ssh-ed25519" >> /etc/ssh/sshd_config
systemctl restart sshd
版权声明:本文为yunzou7157原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。