|
@@ -78,7 +78,7 @@ function configure_ssh {
|
78
|
78
|
echo "KexAlgorithms $SSH_KEX" >> /etc/ssh/sshd_config
|
79
|
79
|
fi
|
80
|
80
|
|
81
|
|
- apt-get -yq install fail2ban
|
|
81
|
+ apt-get -yq install fail2ban vim-common
|
82
|
82
|
|
83
|
83
|
function_check configure_firewall_for_ssh
|
84
|
84
|
configure_firewall_for_ssh
|
|
@@ -153,7 +153,14 @@ function configure_firewall_for_ssh {
|
153
|
153
|
}
|
154
|
154
|
|
155
|
155
|
function get_ssh_server_key {
|
156
|
|
- echo $(ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub | awk -F ' ' '{print $2}')
|
|
156
|
+ if [ -f /etc/ssh/ssh_host_rsa_key.pub ]; then
|
|
157
|
+ echo "RSA Md5:$(ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub | awk -F ' ' '{print $2}')"
|
|
158
|
+ echo "RSA SHA256:$(awk '{print $2}' /etc/ssh/ssh_host_rsa_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64)"
|
|
159
|
+ fi
|
|
160
|
+ if [ -f /etc/ssh/ssh_host_ed25519_key.pub ]; then
|
|
161
|
+ echo "ED25519 Md5:$(ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub | awk -F ' ' '{print $2}')"
|
|
162
|
+ echo "ED25519 SHA256:$(awk '{print $2}' /etc/ssh/ssh_host_ed25519_key.pub | base64 -d | sha256sum -b | awk '{print $1}' | xxd -r -p | base64)"
|
|
163
|
+ fi
|
157
|
164
|
}
|
158
|
165
|
|
159
|
166
|
# NOTE: deliberately no exit 0
|