update 2019-12-19

最近测试发现,重启centos8 的时候,发现opensshserver.config会重置,导致之前加的dss配置失效,还是会让人无法登陆。现在更新新的配置方式

修改 /etc/sysconfig/sshd,打开注释

[root@kvm-centos8 ~]# more /etc/sysconfig/sshd 
#Configuration file for the sshd service.

#The server keys are automatically generated if they are missing.
#To change the automatic creation, adjust sshd.service options for
#example using  systemctl enable [email protected]  to allow creation
#of DSA key or  systemctl mask [email protected]  to disable RSA key
#creation.

#System-wide crypto policy:
#To opt-out, uncomment the following line
CRYPTO_POLICY=

修改/etc/ssh/sshd_config,添加cipher

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
PubkeyAcceptedKeyTypes=+ssh-dss

这样更古老的key,也可以登陆服务器

为了安全,当然不推荐这么做。

-------------------------------------正文分割线----------------------------------------------------------------------

1. 修改/etc/ssh/sshd_config,配置文件末尾添加

PubkeyAcceptedKeyTypes=+ssh-dss

2. 修改/etc/crypto-policies/back-ends/opensshserver.config,配置文件末尾添加

ssh-dss'

3. 重启ssh服务

systemctl restart sshd`