configuring sshd server

This commit is contained in:
John Lancaster
2026-01-04 09:07:00 -06:00
parent dbf1e1f1d1
commit b094a3464c

View File

@@ -54,6 +54,27 @@ ssh_fingerprint() {
ssh-keygen -lf "$cfg_path" | awk '{ print $2 }'
}
if [[ ! -e "/etc/ssh/sshd_config.d/certs.conf" ]]; then
echo "⚠️ sshd not configured to use SSH certs"
read -p "Do you want to configure sshd? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
mkdir -p /etc/ssh/sshd_config.d
cat <<EOF > /etc/ssh/sshd_config.d/certs.conf
TrustedUserCAKeys /etc/ssh/ssh_user_ca.pub
HostKey /etc/ssh/ssh_host_ed25519_key
HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub
EOF
echo -n "Restarting sshd... "
systemctl restart sshd
echo "done"
else
echo "Exiting"
exit 1
fi
fi
check_ssh_files
echo ""