Skip to content

Commit

Permalink
ws: conditional start of ssh-agent
Browse files Browse the repository at this point in the history
In unprivileged mode the label-run script should respect an already existing set SSH_AUTH_SOCK env.
  • Loading branch information
engelant committed Oct 31, 2024
1 parent b66d6c8 commit 1e1ec40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions containers/ws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ You can also mount encrypted private keys inside the container. You can set an e

Private keys can be encrypted; then cockpit uses the provided password to decrypt the key.

### SSH_AUTH_SOCK

By default the container starts its own ssh-agent. Alternatively `SSH_AUTH_SOCK` environment variable can be set to surpress starting ssh-agent.

## More Info

* [Cockpit Project](https://cockpit-project.org)
Expand Down
4 changes: 3 additions & 1 deletion containers/ws/label-run
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ else

/usr/libexec/cockpit-certificate-ensure

eval $(ssh-agent)
if [ -z "$SSH_AUTH_SOCK" ]; then
eval "$(ssh-agent)"
fi
exec /usr/libexec/cockpit-ws --local-ssh "$@"
fi

0 comments on commit 1e1ec40

Please sign in to comment.