# Start sshd once there is a key # # sshd starts only once root or the user agent has an ssh key, so a new VM # has no open port. Root adds the keys after the first boot (README.md). The # ssh.authorized_keys.root credential also fills root's, such as for mkosi ssh. [Unit] Description=Start sshd once an ssh key is set [Path] PathExists=/home/agent/.ssh/authorized_keys PathExists=/root/.ssh/authorized_keys [Install] WantedBy=multi-user.target