Skip to content

Instantly share code, notes, and snippets.

@cweiland
Forked from rechner/freeipa-proxmox.sh
Last active July 11, 2025 22:09
Show Gist options
  • Save cweiland/1bda110edecb9a0e65fe78ff3cae887e to your computer and use it in GitHub Desktop.
Save cweiland/1bda110edecb9a0e65fe78ff3cae887e to your computer and use it in GitHub Desktop.
# Setting up Proxmox with a certificate from FreeIPA.
# This assumes you've already joined the machine with ipa-client-install
# Get a ticket as someone that can issue certificates
kinit admin
cat <<EOF > /usr/local/sbin/set-ssl-permissions
#!/bin/bash
FILES=(/etc/pve/nodes/$(hostname)/{pve-ssl.key,pve-ssl.pem})
chown root:www-data "\${FILES[@]}"
chmod 640 "\${FILES[@]}"
systemctl restart pveproxy
EOF
chmod a+x /usr/local/sbin/set-ssl-permissions
mv /etc/pve/nodes/$(hostname)/pve-ssl.key{,.old}
mv /etc/pve/nodes/$(hostname)/pve-ssl.pem{,.old}
ipa-getcert request -N $(hostname -f) -K HTTP/$(hostname -f) -k /etc/pve/nodes/$(hostname)/pve-ssl.key -f /etc/pve/nodes/$(hostname)/pve-ssl.pem -I pveproxy -C /usr/local/sbin/set-ssl-permissions
ipa-getcert list
# Check that it's not "stuck" and there is no "ca-error" listed
systemctl restart pveproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment