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

the right way to start okc-ssh-agent #2

Closed
532910 opened this issue Nov 16, 2020 · 7 comments
Closed

the right way to start okc-ssh-agent #2

532910 opened this issue Nov 16, 2020 · 7 comments

Comments

@532910
Copy link

532910 commented Nov 16, 2020

I have

ssh_socket=$HOME/../usr/tmp/okc
okc-ssh-agent $ssh_socket 2>/dev/null &|
export SSH_AUTH_SOCK=$ssh_socket

at the end of my zshrc.

I don't see into why, but sometimes I need to rm $SSH_AUTH_SOCK and restart termux.

@532910
Copy link
Author

532910 commented Nov 16, 2020

It should be something like:

export SSH_AUTH_SOCK=$HOME/.ssh/.S_okc-agent
pidof okc-ssh-agent > /dev/null || {
        rm -f $SSH_AUTH_SOCK
        okc-ssh-agent $SSH_AUTH_SOCK &|
}

@532910
Copy link
Author

532910 commented Nov 16, 2020

Readme should be updated.

@DDoSolitary
Copy link
Owner

DDoSolitary commented Nov 17, 2020

It is expected that okc-ssh-agent will fail if the socket file already exists even if there's no process listening on it. It is consistent with the POSIX bind function and the behavior of ssh-agent. However, some other current limitations do make this behavior pretty annoying:

  • ssh-agent will automatically generate a unique file name if no name is given ($TMPDIR/ssh-XXXXXXXXXX/agent.<ppid>), but okc-ssh-agent currently requires a manually specified name.
  • okc-ssh-agent only deletes the socket file on exit triggered by Ctrl+C (SIGINT), but ssh-agent does the deletion on some other exit signals as well (e.g. SIGTERM and SIGHUP)

I plan to implement these missing features so that file name conflict will not happen normally.

@532910
Copy link
Author

532910 commented Nov 17, 2020

to implement these missing features

Not sure if this is required, though possible the same behavior will be more obvious. Anyway something should start it. For example on my desktop it's done with scripts in /etc/X11/Xsession.d, and 90gpg-agent uses always the same socket for ssh agent emulation: /run/user/1000/gnupg/S.gpg-agent.ssh

@DDoSolitary
Copy link
Owner

Anyway something should start it.

IMO, it's the user's job to write the startup script. Though I do agree that it is a good idea to put an example script in readme.

@532910
Copy link
Author

532910 commented Nov 18, 2020

Yep, exactly, I opened this issue to help users write their scripts!

@DDoSolitary
Copy link
Owner

Done.

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

2 participants