Automatic SSH Host Certificates for Cloned VMs
Have new Proxmox VE clones get SSH host certificates from the smallstep CA on first boot
Introduction
A VM cloned from one of my Proxmox VE templates can get an SSH host certificate from my smallstep CA on its first boot, without my doing anything. The certificate is issued for the VM's name, both bare and with a .local suffix (a VM named foo gets a cert for foo and foo.local). It renews itself daily, and the VM also trusts SSH user certificates from the CA. In short, a new clone ends up configured exactly as described in SSH Certificate Configuration, without my touching it.
This page describes how that works and how to set it up. It's written for my setup (a four-node PVE cluster, pve1-pve4, with the CA on ca.familybrown.org), but should adapt easily to others.
How it works
The challenge is that a freshly-cloned VM has no way to prove to the CA who it is: step-ca doesn't have a provisioner that knows anything about Proxmox VMs. So the Proxmox cluster vouches for it instead:
- The templates carry a hookscript, which Proxmox copies into every clone's configuration. When the clone starts, the hookscript (in the
post-startphase) starts/usr/local/sbin/step-enroll-vmas a background systemd unit and returns immediately, so starting the VM never waits for, or fails because of, the enrollment. step-enroll-vmwaits for the QEMU guest agent to respond and for cloud-init to finish (cloud-init sets the hostname and generates fresh SSH host keys for the clone, so nothing can be certified before it's done). If the VM already has an unexpired certificate listing its name, it stops there--so this runs once per VM (and again if the VM is renamed).- It asks the CA for a one-time token by SSH, using a key that can do nothing on
caother than run one script. That script mints a token for exactly<name>and<name>.local, and refuses names on a protected list (the PVE nodes, the CA itself, the NAS boxes, the templates, etc.). The provisioner password never leaves the CA. - It runs the enrollment script inside the VM through the guest agent (
qm guest exec), so no SSH access into the VM is needed. That script installs thestepCLI, has the VM's existing ECDSA host key certified, sets up trust for user certificates, configures sshd, and installs a daily renewal timer (using thesshpopprovisioner). From then on, the VM renews its own certificate.
Things to be aware of:
- Name the VM as you want the host named. The certificate is issued for the VM name (lowercased), and cloud-init sets the hostname from it too. If the VM name isn't a valid hostname, nothing happens.
- The FQDN and IP address are not in the certificate, so
ssh foo.familybrown.orgorssh 192.168.1.xwon't be trusted through the CA, thoughssh fooandssh foo.localwill. If you want more names on a particular VM, re-enroll it by hand withstep-host-enroll, which accepts extra principals..localnames will also only resolve if the guest runs mDNS (e.g.,avahi-daemon), which the cloud images don't include by default. - Trust boundary: root on any PVE node can obtain a host certificate for any name that isn't protected. Since root on a PVE node already controls every VM, I don't see this as a meaningful loss of security, but it's the boundary nonetheless.
- Every cluster node needs the scripts. A clone can start on any node, and if the hookscript file is missing on that node, Proxmox will refuse to start the VM. When adding a node to the cluster, install these files (and add its key on the CA) first.
- The guest needs to reach
ca.familybrown.organd GitHub (to download thestepCLI) on first boot.
Setting it up
On the CA
Create a dedicated user, which will be allowed to run only the token-minting script:
sudo useradd -r -m -d /var/lib/stepmint -s /bin/sh stepmint
sudo passwd -l stepmint
echo 'stepmint ALL=(root) NOPASSWD: /usr/local/sbin/step-mint-host-token' | sudo tee /etc/sudoers.d/stepmint
sudo chmod 0440 /etc/sudoers.d/stepmint
sudo install -d -m 0700 -o stepmint -g stepmint /var/lib/stepmint/.ssh
Save this as /usr/local/sbin/step-mint-host-token (mode 0755, owned by root). It assumes the JWK provisioner's password is in /etc/step-ca/secrets/admin-provisioner.password, readable only by root:
#!/bin/bash
# Mint a one-time SSH host-cert token for a freshly cloned PVE VM.
# Called over SSH by pve1-4 (/usr/local/sbin/step-enroll-vm) as user stepmint, whose
# authorized_keys forces this script; it re-execs itself as root via a sudoers rule
# limited to this file. Principals are fixed: <name> and <name>.local only.
# Names matching a line (anchored ERE) in /etc/step-ca/protected-hostnames are refused.
set -euo pipefail
P=/etc/step-ca/protected-hostnames
if [ "$(id -u)" != 0 ]; then
arg=${SSH_ORIGINAL_COMMAND:-${1:-}}
logger -t step-mint "request for '${arg}' from ${SSH_CLIENT%% *}"
exec sudo -n "$0" "$arg"
fi
name=$(printf '%s' "${1:-}" | tr 'A-Z' 'a-z')
[[ $name =~ ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ ]] || { echo "refused: invalid hostname" >&2; exit 2; }
if grep -qxE -f <(grep -v "^[[:space:]]*\(#\|$\)" $P) <<<"$name"; then
logger -t step-mint "refused protected name $name"; echo "refused: $name is protected" >&2; exit 3
fi
tok=$(step ca token "$name" --ssh --host --provisioner [email protected] \
--password-file /etc/step-ca/secrets/admin-provisioner.password \
--ca-url https://ca.familybrown.org --root /etc/step-ca/certs/root_ca.crt \
--principal "$name" --principal "$name.local" 2>/dev/null)
logger -t step-mint "issued host token for $name ($name, $name.local)"
echo "$tok"
Save the protected names as /etc/step-ca/protected-hostnames. Each line is a regular expression which must match the whole name:
/var/lib/stepmint/.ssh/authorized_keys gets one line per PVE node, in this form (the key comes from the next section). The from= option limits each key to that node's address, and command= means the key can run nothing but the minting script:
from="192.168.1.3",restrict,command="/usr/local/sbin/step-mint-host-token" ssh-ed25519 AAAA... step-mint@pve1
Make sure that file is owned by stepmint and mode 0600.
On every PVE node
Create the key the node uses to ask for tokens, and add its public key to the CA as above:
ssh-keygen -t ed25519 -N '' -C "step-mint@$(hostname)" -f /root/.ssh/id_step_mint
cat /root/.ssh/id_step_mint.pub
The PVE node must already trust the CA's own host certificate (in my case, through the @cert-authority line in the cluster's /etc/pve/priv/known_hosts), or connections to the CA will fail. Test it with ssh -i /root/.ssh/id_step_mint [email protected] testname, which should print a long token beginning eyJ.
Save the hookscript as /var/lib/vz/snippets/step-enroll-hook.sh (mode 0755):
#!/bin/sh
# PVE hookscript (attached to templates 901-903, inherited by their clones).
# On post-start, hands off to /usr/local/sbin/step-enroll-vm in a transient systemd
# unit so the VM start never waits on or fails because of SSH cert enrollment.
# Logs: journalctl -u 'step-enroll-vm-*'
vmid=$1 phase=$2
[ "$phase" = post-start ] || exit 0
[ -x /usr/local/sbin/step-enroll-vm ] || exit 0
systemctl reset-failed "step-enroll-vm-$vmid" >/dev/null 2>&1 || true # allow a retry after a failed run
systemd-run --quiet --no-block --unit="step-enroll-vm-$vmid" \
/usr/local/sbin/step-enroll-vm "$vmid" >/dev/null 2>&1 || true
exit 0
Save the enrollment job as /usr/local/sbin/step-enroll-vm (mode 0755):
#!/bin/bash
# Enroll a PVE VM (clone of a template carrying step-enroll-hook.sh) with the Brown
# Tiny CA: SSH host cert for <VM name> and <VM name>.local, user-CA trust, daily
# sshpop renewal. Runs once per name: skips VMs whose cert already lists the VM name
# and is unexpired. Token from ca via the restricted stepmint key; in-guest work is
# step-enroll-guest.sh run through the QEMU guest agent (no SSH into the VM).
# Usage: step-enroll-vm <vmid> [--force]
set -uo pipefail
vmid=${1:?vmid}; force=${2:-}
GUEST=/usr/local/share/step-enroll/step-enroll-guest.sh
log() { echo "vm $vmid${name:+ ($name)}: $*"; }
name=
# qm guest exec prints JSON; return exitcode, print out/err data
gexec() { # gexec <timeout> <cmd...> (stdin passed through when STDIN=1)
local t=$1; shift
local o; o=$(qm guest exec "$vmid" --timeout "$t" ${STDIN:+--pass-stdin 1} -- "$@" 2>&1) || { echo "$o" >&2; return 255; }
perl -MJSON::PP -e 'my $j=eval{decode_json(join "",<STDIN>)} or do {print STDERR "bad json\n"; exit 255};
print $j->{"out-data"}//""; print STDERR $j->{"err-data"}//"";
exit($j->{exited} ? ($j->{exitcode}//255) : 124)' <<<"$o"
}
cfg=$(qm config "$vmid") || exit 1
grep -q '^template: 1' <<<"$cfg" && exit 0
name=$(sed -n 's/^name: //p' <<<"$cfg" | tr 'A-Z' 'a-z')
[[ $name =~ ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ ]] || { log "VM name is not a valid hostname; skipping"; exit 0; }
# guest agent (first boot of a clone can take a while)
for i in $(seq 1 60); do qm agent "$vmid" ping >/dev/null 2>&1 && break; sleep 10; done
qm agent "$vmid" ping >/dev/null 2>&1 || { log "guest agent not responding after 10 min; giving up"; exit 1; }
# let cloud-init finish (hostname, fresh host keys) before certifying anything
# (the agent can drop requests while cloud-init is still busy early in first boot: retry)
ci=
for i in $(seq 1 20); do
gexec 900 sh -c 'command -v cloud-init >/dev/null || exit 0; cloud-init status --wait >/dev/null; s=$?; [ $s = 2 ] && exit 0; exit $s' >/dev/null 2>&1
r=$?
case $r in
0) ci=done; break;;
124|255) sleep 15;; # agent hiccup / exec did not complete
*) ci="errors (rc $r)"; break;;
esac
done
case $ci in done) ;; "") log "could not confirm cloud-init finished; continuing";; *) log "cloud-init reported $ci; continuing";; esac
if [ "$force" != --force ]; then
if gexec 30 sh -c '
for c in /etc/ssh/ssh_host_ecdsa_key-cert.pub /etc/ssh/ssh_host_ecdsa_key2-cert.pub; do
[ -f "$c" ] || continue
ssh-keygen -L -f "$c" | awk "/Principals:/{f=1;next} /Critical Options:/{f=0} f{print \$1}" | grep -qx "$1" || continue
to=$(ssh-keygen -L -f "$c" | sed -n "s/.*Valid: from .* to //p")
[ "$(date -d "$to" +%s 2>/dev/null || echo 0)" -gt "$(date +%s)" ] && exit 0
done; exit 1' sh "$name" >/dev/null; then
log "already has a valid host cert for $name; nothing to do"; exit 0
fi
fi
h=$(gexec 30 hostname -s | tr -d '\r\n')
[ "$h" = "$name" ] || log "WARNING: guest hostname is '$h', certifying VM name '$name'"
tok=$(ssh -o BatchMode=yes -o ConnectTimeout=10 -o SendEnv=-LC_ALL -i /root/.ssh/id_step_mint \
[email protected] "$name" 2>/dev/null | tail -1)
[[ $tok == eyJ* ]] || { log "CA refused or unreachable (protected name?)"; exit 1; }
log "enrolling ($name, $name.local)"
{ printf '%s\n%s\n' "$tok" "$name"; cat "$GUEST"; } \
| STDIN=1 gexec 600 bash -c 'read -r TOKEN; read -r KEYID; export TOKEN KEYID; exec bash -s' \
| sed "s/^/vm $vmid ($name): /"
rc=${PIPESTATUS[1]}
[ "$rc" = 0 ] && log "enrolled" || log "enrollment FAILED (rc $rc)"
exit "$rc"
And save the in-guest script as /usr/local/share/step-enroll/step-enroll-guest.sh (mode 0644). It's the same script step-host-enroll uses when enrolling existing hosts by hand over SSH:
#!/bin/bash
# In-host half of SSH host-cert enrollment with the Brown Tiny CA (Debian/Ubuntu or RHEL family + systemd).
# Shared by ~/bin/step-host-enroll (fed over ssh) and the PVE clone hook
# /usr/local/sbin/step-enroll-vm (fed through `qm guest exec --pass-stdin`).
#
# Input: run as root with TOKEN (one-time JWK SSH host token) and KEYID in the
# environment. The callers use this wrapper so the token never hits argv:
# bash -c 'read -r TOKEN; read -r KEYID; export TOKEN KEYID; exec bash -s'
# with stdin = token line, key-id line, then this script.
#
# Host key: the host's existing /etc/ssh/ssh_host_ecdsa_key if sshd already serves
# it, else /etc/ssh/ssh_host_ecdsa_key2 (wiki convention). A separate key2 with a
# cert breaks OpenSSH clients that pinned ssh_host_ecdsa_key without trusting the
# CA (e.g. TrueNAS replication): they ask for the cert first, get key2, and see a
# changed key.
set -euo pipefail
export HOME=/root
CA_URL=https://ca.familybrown.org
FP=2f477e4bd5cddf3908521e57f4884247388123be6c1faae80caf883c1b2a3153
STEP_VER=0.31.0
: "${TOKEN:?TOKEN not set}" "${KEYID:?KEYID not set}"
# sshd -T needs the privsep dir, which socket-activated sshd (Ubuntu 24.04+) only
# creates once ssh.service has started.
install -d -m 0755 /run/sshd
K2=/etc/ssh/ssh_host_ecdsa_key2
if sshd -T 2>/dev/null | awk '$1=="hostkey"{print $2}' | grep -qx /etc/ssh/ssh_host_ecdsa_key; then
K=/etc/ssh/ssh_host_ecdsa_key
else
K=$K2
fi
echo "certifying host key $K"
# step CLI
have=$(step version 2>/dev/null | sed -n '1s#.*CLI/\([0-9.]*\).*#\1#p' || true)
if [ "$have" != "$STEP_VER" ]; then
rel=https://github.com/smallstep/cli/releases/download/v$STEP_VER; t=$(mktemp -d)
if command -v dpkg >/dev/null; then
arch=$(dpkg --print-architecture)
curl -fsSL --retry 5 --retry-all-errors -o "$t/step.deb" "$rel/step-cli_$STEP_VER-1_$arch.deb"
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=600 install -y -qq "$t/step.deb" >/dev/null
elif command -v rpm >/dev/null; then # RHEL family (Rocky, Alma, Fedora): no deps, so plain rpm
curl -fsSL --retry 5 --retry-all-errors -o "$t/step.rpm" "$rel/step-cli-$STEP_VER-1.$(uname -m).rpm"
rpm -U --replacepkgs --quiet "$t/step.rpm"
else
echo "neither dpkg nor rpm found; install step $STEP_VER by hand" >&2; rm -rf "$t"; exit 1
fi
rm -rf "$t"
fi
echo "step: $(step version | head -1)"
step ca bootstrap --ca-url $CA_URL --fingerprint $FP --install --force >/dev/null 2>&1
# host key + cert
[ -f $K ] || ssh-keygen -q -t ecdsa -b 256 -N '' -C "$KEYID" -f $K
step ssh certificate --host --sign --force --token "$TOKEN" "$KEYID" $K.pub >/dev/null 2>&1 \
|| step ssh certificate --host --sign --force --token "$TOKEN" "$KEYID" $K.pub
chmod 0644 $K-cert.pub
# user CA trust
step ssh config --roots > /etc/ssh/ssh_user_key.pub.new
grep -q '^ecdsa-sha2-nistp256 ' /etc/ssh/ssh_user_key.pub.new && mv /etc/ssh/ssh_user_key.pub.new /etc/ssh/ssh_user_key.pub
# sshd config. Two traps:
# 1. Any HostKey line disables sshd's implicit default keys.
# 2. Clients that pinned this host's keys must keep seeing the same keys, so
# only keys sshd already serves are listed (key2 only where it already was).
# HostKey lines in the main file are commented out so nothing loads twice.
# Afterwards, every host key fingerprint served before must still be served.
C=/etc/ssh/sshd_config.d/smallstep.conf; M=/etc/ssh/sshd_config
svc=ssh; systemctl cat ssh.service >/dev/null 2>&1 || svc=sshd
before=$(sshd -T | awk '$1=="hostkey"{print $2}')
echo "host keys before: $(echo $before)"
fp_before=$(ssh-keyscan 127.0.0.1 2>/dev/null | ssh-keygen -lf - 2>/dev/null | awk '{print $2}' | sort || true)
[ -n "$fp_before" ] || echo "WARNING: could not keyscan 127.0.0.1; served-key check skipped" >&2
cp -p $M /etc/ssh/sshd_config.pre-step-enroll
[ -f $C ] && cp -p $C /etc/ssh/smallstep.conf.pre-step-enroll
restore() {
cp -p /etc/ssh/sshd_config.pre-step-enroll $M
if [ -f /etc/ssh/smallstep.conf.pre-step-enroll ]; then cp -p /etc/ssh/smallstep.conf.pre-step-enroll $C; else rm -f $C; fi
systemctl try-reload-or-restart $svc || true
}
if ! grep -qsE '^\s*Include\s+/etc/ssh/sshd_config\.d/' $M; then
sed -i '1i Include /etc/ssh/sshd_config.d/*.conf' $M
echo "added sshd_config.d Include (backup: sshd_config.pre-step-enroll)"
fi
mkdir -p /etc/ssh/sshd_config.d
{
echo "# Brown Tiny CA (step-ca on ca.familybrown.org) - managed by step-host-enroll"
echo "# Only keys this host already served; the cert is for one of them (see step-enroll-guest.sh)."
echo "TrustedUserCAKeys /etc/ssh/ssh_user_key.pub"
for k in $before; do
[ "$K" != "$K2" ] && [ "$k" = "$K2" ] && continue # retire key2 when certifying the standard key
echo "HostKey $k"
done
printf '%s\n' $before | grep -qx "$K" || echo "HostKey $K"
echo "HostCertificate $K-cert.pub"
} > $C
sed -i -E 's|^(\s*HostKey\s+.*)$|#\1 # moved to sshd_config.d/smallstep.conf|I' $M
sshd -t || { echo "ABORT: sshd -t failed; restoring" >&2; restore; exit 1; }
after=$(sshd -T | awk '$1=="hostkey"{print $2}')
echo "host keys after: $(echo $after)"
missing=$(comm -23 <(printf '%s\n' $before | sort) <(printf '%s\n' $after | sort) | { [ "$K" != "$K2" ] && grep -vxF "$K2" || cat; } || true)
[ -z "$missing" ] || { echo "ABORT: would drop host keys: $missing; restoring" >&2; restore; exit 1; }
systemctl try-reload-or-restart $svc; sleep 1
if [ -n "$fp_before" ]; then
fp_after=$(ssh-keyscan 127.0.0.1 2>/dev/null | ssh-keygen -lf - 2>/dev/null | awk '{print $2}' | sort || true)
k2fp=$( [ "$K" != "$K2" ] && [ -f $K2.pub ] && ssh-keygen -lf $K2.pub | awk '{print $2}' ) || true
gone=$(comm -23 <(echo "$fp_before" | grep -vxF "${k2fp:-none}") <(echo "$fp_after"))
[ -z "$gone" ] || { echo "ABORT: no longer serving host key(s) $gone; restoring" >&2; restore; exit 1; }
echo "served host keys unchanged"
fi
# renewal units
cat > /etc/systemd/system/ssh-host-cert.service <<UNIT
[Unit]
Description=Renew SSH host certificate (sshpop)
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
Environment=HOME=/root
ExecStart=/usr/bin/step ssh renew --force $K-cert.pub $K
ExecStartPost=/bin/systemctl try-reload-or-restart $svc.service
UNIT
cat > /etc/systemd/system/ssh-host-cert.timer <<'UNIT'
[Unit]
Description=Renew SSH host certificate daily
[Timer]
OnCalendar=daily
RandomizedDelaySec=2h
Persistent=true
[Install]
WantedBy=timers.target
UNIT
systemctl daemon-reload
systemctl disable ssh-host-cert.service >/dev/null 2>&1 || true
systemctl enable --now ssh-host-cert.timer >/dev/null 2>&1
systemctl try-reload-or-restart $svc.service
systemctl reset-failed ssh-host-cert.service 2>/dev/null || true
systemctl start ssh-host-cert.service # prove sshpop renewal works
ssh-keygen -L -f $K-cert.pub | grep -E 'Key ID|Valid|^ {16}'
echo "timer: $(systemctl is-enabled ssh-host-cert.timer), last renew: $(systemctl show -p Result --value ssh-host-cert.service)"
Once, for the cluster
The local storage doesn't allow snippets by default; enable them (this only adds a content type, and doesn't touch anything already stored there):
pvesm set local --content vztmpl,iso,backup,snippets
On each template
Attach the hookscript. This has to be done at the shell; the web interface shows it under Options, but can't set it:
qm set <template ID> --hookscript local:snippets/step-enroll-hook.sh
Clones made before this won't have the hookscript; you can add it to them the same way, or enroll them by hand. The template must have the QEMU guest agent installed and enabled, which the template instructions already cover.
RHEL-family templates (Rocky Linux 9)
Debian and Ubuntu templates need nothing more. On Rocky (and presumably Alma and RHEL), two of the distribution's defaults block the enrollment, and both have to be changed in the template image. Note that both widen what root on a PVE node can do inside these VMs to what it can already do in the Debian and Ubuntu ones.
-
The guest agent refuses
guest-exec./etc/sysconfig/qemu-galimits the agent to an allow-list (FILTER_RPC_ARGS="--allow-rpcs=...") that leaves out command execution, soqm guest execfails withCommand guest-exec has been disabled. Addguest-execandguest-exec-statusto that list (the file-access RPCs stay blocked):virt-customize -a <image> --edit '/etc/sysconfig/qemu-ga:s/^(FILTER_RPC_ARGS="--allow-rpcs=)/$1guest-exec,guest-exec-status,/' -
SELinux confines whatever the agent runs. Commands run through
guest-execstay in the agent's own domain,virt_qemu_ga_t, which may not run ordinary programs: the enrollment fails withFailed to execute child process "hostname" (Permission denied)andneither dpkg nor rpm found, and the guest's audit log showsavc: deniedforscontext=...virt_qemu_ga_t. Make just that domain permissive; SELinux stays enforcing for everything else, and the agent's denials are still logged:echo '(typepermissive virt_qemu_ga_t)' > permissive_virt_qemu_ga_t.cil virt-customize -a <image> --upload permissive_virt_qemu_ga_t.cil:/root/permissive_virt_qemu_ga_t.cil \ --run-command 'semodule -n -X 400 -i /root/permissive_virt_qemu_ga_t.cil && rm /root/permissive_virt_qemu_ga_t.cil'The module has the same name
semanage permissive -a virt_qemu_ga_twould give it, so on a running VMsemanage permissive -llists it andsemanage permissive -d virt_qemu_ga_tremoves it.
As always after virt-customize, truncate /etc/machine-id again. The in-guest script installs the step CLI from smallstep's RPM on these systems (rpm warns NOKEY about the package signature, which is harmless), and the rest of it works unchanged: Rocky's sshd_config already includes sshd_config.d, and the service is sshd.
Using it
Just clone a template and start the VM. Within a minute or two of first boot (most of which is cloud-init), it will have its certificate. To watch it, or see what happened, on the node where the VM is running:
journalctl -u step-enroll-vm-<VM ID>
A successful run ends with the certificate's details and enrolled; later boots log already has a valid host cert ... nothing to do. To run it again by hand (for example, after fixing a problem), use /usr/local/sbin/step-enroll-vm <VM ID>, adding --force to re-enroll a VM that already has a valid certificate. Failed runs are also retried at the VM's next start. The CA logs each token request; see journalctl -t step-mint on ca.
Problems I ran into
- The guest agent is flaky during first boot. It can answer a ping but then fail the next command while cloud-init is busy (
Agent error: Invalid parameter 'pid'). The enrollment job retries until it gets a real answer about cloud-init's status. - cloud-init may still be running
apt, so installing thesteppackage can fail on the dpkg lock. The in-guest script waits up to 10 minutes for the lock. - Ubuntu 24.04 uses socket-activated sshd, so until the first SSH connection,
ssh.serviceisn't running and/run/sshddoesn't exist. Without that directory,sshd -Tfails, and the script would conclude sshd isn't using the standard ECDSA host key. The script creates the directory, and only reloads sshd if it's running. - Rocky's guest agent and SELinux block it, until the template is adjusted as described under RHEL-family templates. Rocky's agent otherwise works fine; it's only command execution that's disabled.
- Certify the existing ECDSA host key, not a new
ssh_host_ecdsa_key2. This is explained on the SSH Certificate Configuration page; the in-guest script handles it.