You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Goldstein Lyor (JIRA)" <ji...@apache.org> on 2016/09/26 05:32:20 UTC

[jira] [Commented] (SSHD-700) SSHD does not suppot agent forwarding for XShell and XAgent

    [ https://issues.apache.org/jira/browse/SSHD-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15522110#comment-15522110 ] 

Goldstein Lyor commented on SSHD-700:
-------------------------------------

XShell_ seems to be referring to [Secure Shell Authentication Agent Protocol - Draft 2|https://tools.ietf.org/html/draft-ietf-secsh-agent-02]. Your code seems correct, but agent forwarding is not my specialty. An initial search shows that the following might work:

1. Define a new class that extends {{ChannelAgentForwardingFactory}} and override its {{getName()}} method to return {{auth-agent-req}}.
2. When initializing the *server* add your factory to the server's:
{code:java}
SshServer server = SshServer.setupDefaultServer();
List<NamedFactory<Channel>> factories = server.getChannelFactories();
List<NamedFactory<Channel>> updated = new ArrayList<>(factories.size() + 1);
updated.addAll(factories);
updated.add(new MyForwardingFactory());
server.setChannelFactories(updated);
server.start();
{code}

I believe this should work

> SSHD does not suppot agent forwarding for XShell and XAgent
> -----------------------------------------------------------
>
>                 Key: SSHD-700
>                 URL: https://issues.apache.org/jira/browse/SSHD-700
>             Project: MINA SSHD
>          Issue Type: New Feature
>    Affects Versions: 1.2.0
>         Environment: Windows 10 and CentOS 7
> XShell 5.0
>            Reporter: Li Fangning
>            Priority: Minor
>         Attachments: SshdTest2.java
>
>
> I use MINA SSHD for both server side and client side:
> SSH client  --> MINA SSHD Server - MINA SSHD Client --> Target Linux Server
> I use XShell (http://www.netsarang.com/) as SSH client, and use XAgent with XShell for target server authentication (Public Key Access with Agent Forwarding).
> I have tried PuTTY (with pagent), SecureCRT, and openssh client in linux, they are all passed. But when I try XShell with XAgent, the agent forwarding phase is failed.
> When I check the debug log and source code of MINA SSHD, I find that SSHD only handle the "auth-agent-req@openssh.com" request type (in org.apache.sshd.server.channel.ChannelSession#handleInternalRequest), which is OK for PuTTY, SecureCRT and openssh client. But XShell send a "auth-agent-req" request (without "@openssh.com"), so SSHD not handle the request.
> I have try to change the source code, add "auth-agent-req" to the "switch-case" in handleInternalRequest, but the authentication is blocked.
> I have attached my code, please help me solve the problem.
> Thanks a lot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)