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 libssh2_channel_request_auth_agent in with-ssh-connection macro #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svetlyak40wt
Copy link

When :forward-agent t argument is passed to with-ssh-connection macro,
it will use libssh2_channel_request_auth_agent call before execution the body.

The function was merged on 13 August 2019
and should be included in the libssh2 > 1.9.0 which is not released yet.

Warning

This code works without errors for me, but agent is not forwarded.

Steps to reproduce:

  1. Install fresh libssh2 from the GitHub: brew install --build-from-source libssh2 --HEAD
  2. Run this code:
(defun test-github (host)
           (flet ((-> (from to)
                    (loop for line = (read-line from nil nil)
                          while line
                          do (write-string line to)
                             (terpri))))
             (ssh:with-connection (conn host (ssh:agent "root"))
               (ssh:with-command (conn stream "ssh -T [email protected]")
                                 (-> stream *standard-output*)))))


(test-github "some-host-where-i-have-access")

Expected output is:

Hi svetlyak40wt! You've successfully authenticated, but GitHub does not provide shell access.

Actual output:

[email protected]: Permission denied (publickey).

Final note

I wasn't able to compile original agent forwarding example from libssh2 to check if the C library works as expected.

Maybe somebody can help me with that?

… macro

When `:forward-agent t` argument is passed to `with-ssh-connection` macro,
it will use libssh2_channel_request_auth_agent call before execution the body.

The function [was merged](libssh2/libssh2#219) on 13 August 2019
and should be included into the libssh2 > 1.9.0 which is not released yet.
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

Successfully merging this pull request may close these issues.

1 participant