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

2017-07-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SSHD-700:
-

Github user lifangning closed the pull request at:

https://github.com/apache/mina-sshd/pull/34


> 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
>Assignee: Goldstein Lyor
>Priority: Minor
> Fix For: 1.7.0
>
> Attachments: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, sshd-core.zip, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2017-07-13 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Hi Goldstein,

I have made changes based on your suggestions.
Please re-check the codes.
Thanks

> 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: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, sshd-core.zip, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2017-07-12 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Hi Li,

I have posted my comments on the code you published in the pull request - in 
general, it is OK - except for a few minor issue that need to be fixed.

{quote}The UnixAgentFactory use Tomcat JNI, but I don't think it is 
necessary{quote}

The usage of Tomcat JNI is neither here nor there - the JNI provides some 
useful performance improvements. Although you make a good point - perhaps the 
choice between the {{LocalAgentFactory}} and the {{UnixAgentFactory}} should be 
made based on some user-defined property whose *default* value should be _Unix_ 
is {{OsUtils.isUnix()}} and _Local_ otherwise. This would mean that the user 
can override this default choice - e.g., if no JNI available/wanted

> 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: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, sshd-core.zip, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2017-07-05 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Hi Goldstein
I have post a new pull request to the project.
Please review the codes.

I have already verified this functionality on both Windows and Linux OS, and 
they all work fine.
The UnixAgentFactory use Tomcat JNI, but I don't think it is necessary (and has 
verified that it is).
It does not require the use of the native code to handling the communication 
protocol.

Thanks.
Best Regards

> 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: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, sshd-core.zip, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2017-06-30 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

I have reviewed the code and have a few questions/issues:

* In {{ProxyAgentFactory}} you replaced {{UnixAgentFactory}} with 
{{LocalAgentFactory}} - have you tested the code on _Unix_ ? Perhaps the 
correct code would be to use:
{code:java}
@Override
public List getChannelForwardingFactories(FactoryManager 
manager) {
return OsUtils.isUnix() ? UnixAgentFactory.DEFAULT_FORWARDING_CHANNELS : 
LocalAgentFactory.DEFAULT_FORWARDING_CHANNELS;
}
{code}
* The code is using cascaded calls - e.g.
{code:java}
session.getProperties().put("agentType", requestType);
rtn.setChannelType((String) getSession().getProperties().get("agentType"));   
<-- what if not set ?
{code}
please avoid such coding as it makes things difficult to read and/or debug.
* Specifically on the issue of properties, you should use
{code:java}
PropertyResolverUtils.updateProperty(session, "agentType", requestType);
PropertyResolverUtils.getString(session, "agentType");
{code}
* We do not repeat strings (e.g. {{agentType}}) - please use a literal constant 
- in this case on the {{FactoryManager}} with the appropriate *documentation* 
comment as to what it is used for. In this context, please note that we do not 
use camel-case - I would suggest a value of {{agent-fw-auth-type}}.
* In the code below, please replace the constants (104, 204) with properly 
named literal constants in {{SshAgentConstants}}. In this context, please add a 
javadoc comment link to the *documentation* on which they are based.
{code:java|title=AbstractAgentProxy#getIdentities}
byte cmd = SshAgentConstants.SSH2_AGENTC_REQUEST_IDENTITIES;
byte okcmd = SshAgentConstants.SSH2_AGENT_IDENTITIES_ANSWER;
if (CHANNEL_TYPE_IETF.equals(channelType)) {
cmd = (byte) 204;
okcmd = (byte) 104;
}
{code}
Please review, fix and re-submit as a pull request

> 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: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, sshd-core.zip, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2017-06-30 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Hi Li,

Thanks for the code - I will review it and see if it can be merged. 2 minor 
issues though:

1. The best way to provide patches is by cloning the public Github repository 
and posting a pull request
2. We are now in the midst of releasing version 1.6 - even if we do merge in 
your patch it will very likely be part of 1.7 or a future release

Thanks again for the contribution
Lyor

> 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: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, sshd-core.zip, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2017-06-29 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Hi Goldstein

We finally solved the issue.
The attachment 'sshd-core.zip' is the source code associated with resolving the 
issue (based on the latest master branch).
Now SSHD can support agent forwarding implementations of both IETF and OpenSSH, 
and the Tomcat APR library is not required.

I am very grateful if it can be merged into the latest release.
Thanks a log.

> 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: block.png, debug.log, environment.png, log1.txt, 
> log2.txt, SshdTest2.java, SshdTest3.java, stacktrace.png
>
>
> 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-...@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.4.14#64029)


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

2016-12-14 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

This is enough.
Thank you...

> 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, SshdTest3.java, block.png, debug.log, 
> environment.png, log1.txt, log2.txt, stacktrace.png
>
>
> 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-...@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)


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

2016-12-14 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

I'll try and have a look at it, but unfortunately, these days I don't have much 
time to spend on the project as I would like. This problem is especially 
difficult since I am having trouble both understanding the exact setup and/or 
re-producing the issue so I can debug it. I'll see what I can do, but it will 
take time...

> 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, SshdTest3.java, block.png, debug.log, 
> environment.png, log1.txt, log2.txt, stacktrace.png
>
>
> 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-...@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)


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

2016-12-14 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Hi Goldstein:

I have post the question to mailing list, but no one answer me.
Today, I pull the latest code and try again.
I compared the normal environment (using openssh) with the abnormal 
environment (using XShell) and saved the logs in attachments log1.txt and 
log2.txt. The key difference are from line 23, The former responds to 
SSH_MSG_CHANNEL_DATA, while the latter responds to SSH_MSG_CHANNEL_EOF.
In the abnormal environment, during the agent forward process, the code is 
blocked at line 80 of org.apache.sshd.agent.local.AgentForwardedChannel (see 
the attachment block.png), and the full call stacktrace is shown in 
stacktrace.png.
Since the OpenSSH way is OK, but the standard "Secure Shell Authentication 
Agent Protocol Draft 02" equivalent is not. I think their protocols may be 
different, but I can not find any clues in google.
Could you help me or give me some hints?

Best Regards

> 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-10-01 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Thank you Goldstein

I am currently on vacation and will continue to follow up on this issue when I 
am back.
If there is any progress, I'll let you know.

Best Regards

> 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-10-01 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Hi [~lfn],

I have gone over the log but have not found anything suspicious. I have merged 
the changes from the branch into the _master_ so you can no clone it instead of 
the special code. I wish I could help more, but like I said, agent forwarding 
is not my forte. What I can suggest is that you post a question on the 
{{dev@mina.apache.org}} mailing list with a reference to this issue and ask for 
the community's help - perhaps someone can put you on the right track. If you 
do solve the issue, I would like to ask you to update this issue along with the 
code that solved it - perhaps as a pull-request - so we can either fix it or 
use it as part of the documentation

> 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-09-28 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

I have pulled the latest code in "SSHD-700" branch, compile and test.
The problem is the same as before.

I have uploaded the new debug.log.
Thanks.

> 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-09-28 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Thanks for your advice.

> 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-09-28 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Please get latest https://github.com/lgoldstein/mina-sshd/tree/SSHD-700 - I 
have not merged the changes in the master 1.4 branch so no wonder your code 
still does not 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-09-28 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Hi Li,

To answer some of your issues:

- The SSH client should be a singleton - there are no multi threading issues.
- The SSH_AUTH_SOCK property is not mixed - each command gets its own 
environment instance
- I have never used agent forwarding code so cannot advise you

Lyor

> 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, SshdTest3.java, debug.log, 
> environment.png
>
>
> 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-...@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)


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

2016-09-28 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Hi, Goldstein

Thank you very much for reviewing my code.
I really appreciate it.

When I started using Apache SSHD a few months ago, due to a lack of 
documentation, I could only use it by learning test cases and constant attempts.
Today I found the professional guidance document has been provided, and 
sincerely happy. Thanks for all your efforts.

I made modifications to my code based on your comments, and re-run it with SSHD 
1.4.0-snapshot, the problem remains.
And I have some questions:
1. I would have liked to use the SSH Client singleton, but some configurations 
may not share for different server shells. If I configure the agentFactory for 
the client instance, but the user do not provide agent forward  property within 
server connection, an exception may throw. In addition, I also worry about 
thread safety for the client object, the "SSH_AUTH_SOCK" property must not be 
mixed for different users. So I prefer to use different SshClient object for 
each server shell, and close it after the client session is closed.
2. If the "channel.setAgentForwarding(true)" is not invoked, the keys won't be 
forwarded to the next host when I use "ssh -A nextHost" (The "SSH_AUTH_SOCK" 
system environment variable won't be set).
3. I have tried the UnixAgentFactory with tomcat jni and APR library in Linux 
server, but the problem is still there. I usually coding on Windows, and the 
ProxyAgentFactory indeed work for the standard agent forwarding 
(auth-agent-...@openssh.com).
The attached file "environment.png" is my environment to reproduce the problem. 
I use Mina SSHD to develop a SSH jump server.
If it is not clear enough, please let me know.

Thanks a lot.

> 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, SshdTest3.java, debug.log
>
>
> 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-...@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)


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

2016-09-28 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Hi Li,

I have not yet been able to set up the test environment (like I said, it will 
take some time), but I do have a few preliminary remarks after reviewing the 
code you posted.

# The code creates a new client instance every time {{startShell}} is called. 
This is *wrong* (please read the documentation). The idea is to create *one* 
client instance during the _main_ initialization and re-use it again and again 
to create sessions. The client should be stopped when the application exits 
(not really 100% necessary, but highly recommended). The code you posted 
creates lots of thread, pools, etc. where they are not needed.
# The code does not register a {{ForwardingFilter}} at the client or the server 
- this means that *no forwarding may occur* - again, please read the 
documentation that was recently posted on the [Github MINA 
site|https://github.com/apache/mina-sshd].
# The authentication process is *wrong*- if will always fail the 1st time and 
require the password since you do not provide a key-pair identity - again, 
please read the documentation how to properly execute the authentication.
# Please don't 2nd guess the API - if you need a {{ChannelShell}} call the 
appropriate API:
{code:java}
ChannelShell channel = session.createShellChannel();
{code}
# Your code checks
{code:java}
if (env.getEnv().containsKey("SSH_AUTH_SOCK")) {
channel.setAgentForwarding(true);
}
{code}
you actually already checked this in:
{code:java}
if (env.getEnv().containsKey(SshAgent.SSH_AUTHSOCKET_ENV_NAME))
{code}
# you are setting up the server to use the {{ProxyAgentFactory}} - which 
actually uses {{UnixAgentFactory}} and this requires the [Apache Portable 
Runtime Library|https://apr.apache.org/] - have you installed it ? configured 
it ? Made sure it is available for loading in the {{LD_LIBRARY_PATH}} (see 
{{AprLibrary}} class) ?
In this context, I have never seen this kind of agent proxy run on _Windows_ - 
it's not impossible, just much more complicated than _Unix_. I mention this 
because _XShell_ and _XAgent_ are _Windows_ application and I am not clear as 
to the set-up you are trying to test (see further below).
# Finally, in order to correctly debug this issue, please describe *exactly* 
the setup your are trying to use - who is the client (_XShell_?) ? Who is the 
server ? Who is the agent (_XAgent ?) ? How are they set up, etc... I recommend 
you attach some text or PDF document that explains this - perhaps some drawing 
of the set up environment

> 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, SshdTest3.java, debug.log
>
>
> 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-...@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)


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

2016-09-27 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Thank you very much.
If I can do anything help, please let me know.

> 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, SshdTest3.java, debug.log
>
>
> 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-...@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)


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

2016-09-27 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

No problem, but be patient, it will take me some time to set up the development 
environment and test the code.

> 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, SshdTest3.java, debug.log
>
>
> 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-...@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)


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

2016-09-26 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Hi Goldstein

It still does not work.
I have attached my test code (SshdTest3.java) and the debug output (debug.log).
Please help me out.

The XShell download link:
https://www.netsarang.com/download/down_xsh5.html?token=RUg4aE5iQ2xIaTg1SkVPSnJoR2Vsd0BneE1PS0VSemluU29pN1JTN2xINnRn
OR
http://download.findmysoft.com/2016/09/12/XShell_5.0-Build-1019.exe
We can use it free from home and school.

After install, select Tools > Launch Xagent to start XAgent and manage keys.
When create a SSH connection, make sure the Connection > SSH > Use Xagent (SSH 
agent) for handling passphrase is checked.

Thanks a lot!

> 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, SshdTest3.java, debug.log
>
>
> 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-...@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)


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

2016-09-26 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

Hi Li,

Please try to clone https://github.com/lgoldstein/mina-sshd/tree/SSHD-700 
compile it and see if it solves your problem. Try debugging it if it doesn't 
and maybe diagnose what is failing - I cannot re-create it.

*Note:* some special initialization may be required similar to what I already 
showed - see {{ChannelAgentForwardingFactory OPENSSH/IETF}} implementations as 
well as {{SshAgentServer.PROXY_CHANNEL_TYPE}} configuration value. I believe 
some kind of combination of the 2 should do the trick.

Is there some way I can re-create your problem ? I cannot download and install 
_XShell_ for various reasons, so I cannot test it locally. If you can suggest 
some way to use _XShell_ that would be a great help - otherwise, I rely on you 
to debug the code and suggest a fix (please make sure that the fix does not 
break backward compatibility)

> 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-...@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)


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

2016-09-26 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

I followed the steps above, but it does not 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-...@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)


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

2016-09-26 Thread Li Fangning (JIRA)

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

Li Fangning commented on SSHD-700:
--

Thanks alot.

> 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-...@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)


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

2016-09-26 Thread Goldstein Lyor (JIRA)

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

Goldstein Lyor commented on SSHD-700:
-

I have made some changes and may have something along these lines soon (on 
version 1.4 though...)

> 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-...@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)


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

2016-09-25 Thread Goldstein Lyor (JIRA)

[ 
https://issues.apache.org/jira/browse/SSHD-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 factories = server.getChannelFactories();
List 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-...@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)