From 36fb7c5bd0b8d79ce6f0274b9fb9960714020248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fiere?= Date: Fri, 24 Feb 2023 11:22:39 +0200 Subject: [PATCH] Created Proxmox VE 7.3-6 (markdown) --- Proxmox-VE-7.3-6.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Proxmox-VE-7.3-6.md diff --git a/Proxmox-VE-7.3-6.md b/Proxmox-VE-7.3-6.md new file mode 100644 index 0000000..d15d46c --- /dev/null +++ b/Proxmox-VE-7.3-6.md @@ -0,0 +1,42 @@ +Same instructions as [Ubuntu 22.04 LTS Server](https://www.ssh-audit.com/hardening_guides.html#ubuntu_22_04_lts), +except, remove `sntrup761x25519-sha512@openssh.com` from `KexAlgorithms` in step 4, as it is not supported out of the box. + +That is : + +__Note:__ all commands below are to be executed as the _root_ user. + +### 0. Make a backup of your _ssh_ folder as a precaution +``` +cp -r /etc/ssh /etc/_ssh.back +``` +### 1. Re-generate the RSA and ED25519 keys +``` +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 "" +``` +### 2. Remove small Diffie-Hellman moduli +``` +awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe +mv /etc/ssh/moduli.safe /etc/ssh/moduli +``` +### 3. Enable the RSA and ED25519 keys +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 +``` +### 4. Restrict supported key exchange, cipher, and MAC algorithms +``` +cat < /etc/ssh/sshd_config.d/ssh-audit_hardening.conf +# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com +# hardening guide. +KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,gss-curve25519-sha256-,diffie-hellman-group16-sha512,gss-group16-sha512-,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256 +Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr +MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128-etm@openssh.com +HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256,rsa-sha2-256-cert-v01@openssh.com +EOF +``` +### 5. Restart OpenSSH server +``` +service ssh restart +``` \ No newline at end of file