Skip to content

Commit d19d9f4

Browse files
qiluo-msfttiantianlv
authored andcommitted
[security] Do not generate ssh server keys for non RSA protocols (sonic-net#2718)
1 parent d0c9d6a commit d19d9f4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

files/sshd/host-ssh-keygen.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/bash
22

3+
set -e
4+
35
[ -r /etc/ssh/ssh_host_rsa_key ] || {
46
rm -f /etc/ssh/ssh_host_*_key*
57
/usr/bin/ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key
6-
/usr/bin/ssh-keygen -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key
7-
/usr/bin/ssh-keygen -t rsa1 -N '' -f /etc/ssh/ssh_host_key
8-
/usr/bin/ssh-keygen -t ecdsa -N '' -f /etc/ssh/ssh_host_ecdsa_key
9-
/usr/bin/ssh-keygen -t ed25519 -N '' -f /etc/ssh/ssh_host_ed25519_key
108
}

0 commit comments

Comments
 (0)