I’ve got the following service to start and stop the ssh-agent. Which I intend to start/enable for –user.

Problem is I get the error message that [email protected] doesn’t exist. But it does. Strangley I can run systemctl status [email protected] but not with the –user flag So to me it seems that [email protected]%i can’t be used on a user-level service.

Am I doing something wrong or anyone an idea how to stop the ssh-agent properly with systemd?

Description=SSH key agent
After=systemd-user-sessions.service [email protected]%i.service dbus.service
[email protected]%i.service

ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK