0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-03-04 12:58:53 +00:00
termux-packages/packages/openssh/sv/ssh-agent.run.in
Henrik Grimler 995173d5f2 enhance(main/openssh): add ssh-agent service script
Run `sv-enable ssh-agent` to enable the service, and add `export
SSH_AUTH_SOCK="$PREFIX"/var/run/ssh-agent.socket` to .bashrc to make
all terminal sessions use the same agent.

The ssh-agent run script has been put in a subdirectory sv in the
builder dir, and the sshd service script moved there as well. This is
hopefully clearer than trying to put a multiline script in the
TERMUX_PKG_SERVICE_SCRIPT variable.
2025-01-29 19:29:36 +01:00

10 lines
380 B
Bash

#!@TERMUX_PREFIX@/bin/sh
# Run `sv-enable ssh-agent` and add the following to your bashrc (or
# equivalent) to use ssh-agent:
# export SSH_AUTH_SOCK="$PREFIX"/var/run/ssh-agent.socket
# After that you can add your key to the agent with `ssh-add`, and
# then make use of the credentials across all terminal sessions
exec ssh-agent -D -a "$PREFIX"/var/run/ssh-agent.socket 2>&1