-
-
Notifications
You must be signed in to change notification settings - Fork 179
Proxmox VE 7.3 6
Daniel A. Maierhofer edited this page Dec 23, 2023
·
6 revisions
Same instructions as Ubuntu 22.04 LTS Server,
except, remove [email protected]
from KexAlgorithms
in step 4, as support for it was dropped in pve.
That is :
Note: all commands below are to be executed as the root user using bash.
cp -r /etc/ssh /etc/_ssh.back
rm /etc/ssh/ssh_host_*
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ""
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe
mv /etc/ssh/moduli.safe /etc/ssh/moduli
Enable the RSA and ED25519 HostKey directives in the /etc/ssh/sshd_config
file:
sed -i 's/^\#HostKey \/etc\/ssh\/ssh_host_\(rsa\|ed25519\)_key$/HostKey \/etc\/ssh\/ssh_host_\1_key/g' /etc/ssh/sshd_config
cat <<EOF > /etc/ssh/sshd_config.d/ssh-audit_hardening.conf
# Restrict key exchange, cipher, and MAC algorithms, as per community-provided
# hardening guide at: https://github.com/jtesta/ssh-audit/wiki/Proxmox-VE-7.3-6/
KexAlgorithms diffie-hellman-group14-sha256,curve25519-sha256,[email protected],gss-curve25519-sha256-,diffie-hellman-group16-sha512,gss-group16-sha512-,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr
MACs [email protected],[email protected],[email protected]
HostKeyAlgorithms ssh-ed25519,[email protected],[email protected],[email protected],rsa-sha2-512,[email protected],rsa-sha2-256,[email protected]
EOF
service ssh restart
pvecm updatecerts