1. Check OpenSSH version (requires OpenSSH 9.0+):
ssh -V2. Edit SSH server configuration:
Edit /etc/ssh/sshd_config or create /etc/ssh/sshd_config.d/post-quantum.conf:
# Enable post-quantum key exchange algorithms
KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
Note: sntrup761x25519-sha512@openssh.com is listed first, providing post-quantum security while maintaining backward compatibility.
3. Restart SSH service:
# Debian/Ubuntu
sudo systemctl restart sshd
# RHEL/CentOS/Rocky
sudo systemctl restart sshd
# Verify configuration is valid before restarting
sudo sshd -tYou can also configure your client to prefer post-quantum algorithms:
Edit ~/.ssh/config:
Host *
KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org
After configuration, test your SSH connection:
ssh -v user@hostname 2>&1 | grep "kex:"Look for output like:
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com
Connect and check which algorithm is being used:
ssh -o LogLevel=DEBUG user@hostname 2>&1 | grep "kex: algorithm"