If you’re looking for a way to have your SSH agent running automatically when you log in to your manjaro machine—regardless of whether you’re using a graphical interface (X) or not—there’s good news! Since version 9.4p1-3 of OpenSSH, a convenient ssh-agent.service is included that can be enabled as a user unit.
To get started, you need to enable the ssh-agent.service. This service will ensure that your SSH agent starts automatically whenever you log in. You can do this by running the following command in your terminal:
systemctl --user enable ssh-agent.service
Once the service is enabled, you can start it immediately with:
systemctl --user start ssh-agent.service
Next, you need to set the SSH_AUTH_SOCK environment variable. This variable tells your SSH client where to find the SSH agent socket. You can set it to the following value:
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
You can add this line to your shell’s configuration file (like .bashrc or .zshrc) to ensure it is set automatically each time you log in.
It’s easy to auto start ssh agent on Manjaro Linux. Now, I can integrate the agent with my keepassxc.