Foxboron / ssh-tpm-agent

:computer: :key: ssh-agent for TPMs
MIT License
354 stars 20 forks source link

Problem when proxying agent, breaks at one point #20

Closed stigtsp closed 1 year ago

stigtsp commented 1 year ago

This problem occured (after a while):

2023/08/11 17:43:44 failed getting list from agent: agent: client error: write unix @->/run/user/1000/gnupg/S.gpg-agent.ssh: write: broken pipe
2023/08/11 17:43:44 failed getting Signers from agent: &{%!f(string=agent: client error: write unix @->/run/user/1000/gnupg/S.gpg-agent.ssh: write: broken pipe)}
2023/08/11 18:32:04 failed getting list from agent: agent: client error: write unix @->/run/user/1000/gnupg/S.gpg-agent.ssh: write: broken pipe
2023/08/11 18:32:47 failed getting list from agent: agent: client error: write unix @->/run/user/1000/gnupg/S.gpg-agent.ssh: write: broken pipe

User systemd-unit:

[Unit]
Description=A ssh-agent compatible agent that support TPM keys
Documentation=https://github.com/Foxboron/ssh-tpm-agent

[Service]
ExecStart=/home/user/bin/ssh-tpm-agent -A /run/user/1000/gnupg/S.gpg-agent.ssh
ExecReload=/bin/kill -HUP $MAINPID
IPAddressDeny=any
RestrictAddressFamilies=AF_UNIX
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
LockPersonality=yes
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
SystemCallErrorNumber=EPERM
SystemCallArchitectures=native
NoNewPrivileges=yes
KeyringMode=private
UMask=0177
RuntimeDirectory=ssh-tpm-agent

[Install]
WantedBy=default.target
stigtsp commented 1 year ago

This might have been resolved by using the new shiny socket activated systemd units. Continuing to test.

stigtsp commented 1 year ago

Not had this issue anymore, closing