Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OkcAgent #13

Open
gerardo-junior opened this issue Aug 27, 2020 · 2 comments
Open

Support for OkcAgent #13

gerardo-junior opened this issue Aug 27, 2020 · 2 comments

Comments

@gerardo-junior
Copy link

gerardo-junior commented Aug 27, 2020

OkcAgent runs a daemon and set $SSH_AUTH_SOCK to use openkeychain.

command to up service

$PREFIX/bin/okc-ssh-agent $PREFIX/var/run/okc-ssh-agent.sock > /dev/null 2>&1 & echo $! > $PREFIX/var/run/okc-ssh-agent.pid
export SSH_AUTH_SOCK=$PREFIX/var/run/okc-ssh-agent.sock

command to down service

kill -9 $(cat $PREFIX/var/run/okc-ssh-agent.pid)

command to status service

if [ -f /proc/$(cat $PREFIX/var/run/okc-ssh-agent.pid)/exe ]; then
   echo 'okc-ssh-agent is running...'
else
  echo 'okc-ssh-agent is not running...'
fi

more info
https://github.com/DDoSolitary/OkcAgent
DDoSolitary/OkcAgent#18

@Grimler91
Copy link
Member

I don't think this will be possible purely through termux-services. You would need to have some code in your ~/.bashrc to export SSH_AUTH_SOCK anyways, so I am not sure if we want to package a half-working solution into okc-agents

@tcely
Copy link

tcely commented Jul 19, 2021

I've been using ssha for this.

Add a function to the sh ENV file and you can override the path or binary used when ssh-agent is run by the ssha wrapper shell script.

$ cat -v "$ENV"
for _file in ~/.config/sh/rc.d/*.sh
do
    if  [ -s "${_file}" ] &&
        [ -r "${_file}" ]
    then
        . "${_file}"
    fi
done
unset -v _file
$ cat -v ~/.config/sh/rc.d/functions.sh
# Choose okc-ssh-agent as my default.
ssh-agent() {
    builtin command okc-ssh-agent "$@";
}
$ ssh-agent --version
okc-ssh-agent 0.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants