[jira] [Commented] (SSHD-1243) is GitSshdSessionProcess class Git specific?

2022-01-30 Thread Jira


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

dgü commented on SSHD-1243:
---

Hello!

{quote}
The GitSshdSessionProcess won't help you as you'd have to create the ssh 
session and channel, it's just a thin wrapper. You just need the ChannelExec 
which will allow you to run a remote command,
{quote}

I will create required instances (session,exec channel,etc.). No problem here. 
After execution, an {{SSHProcess-like}} class is needed for my implementation.

{quote}
The reason why there's no abstraction is that you need to configure the SSH 
layer: host, port, user, password, ssh private key, host entries, ciphers, 
macs, etc... So we probably won't provide such a thing.
{quote}

I meant an abstraction in JDK level. For another case example, 
{{java.nio.file.spi.FileSystemProvider}} could be used for 
{{SFTPFileSystemProvider}}.

{quote}
And if you think you really need the GitSshdSessionProcess class, just copy it, 
rename it, and hack it to suit your needs.
{quote}

I think it would be better for {{GitSshdSessionProcess}} to be in a core jar 
since it's not Git specific. It would eliminate the dependency for sshd-git 
jar. If not, I will think of copying and renaming {{GitSshdSessionProcess}}.

{quote}
Btw, you're saying you're migrating from Jsch but afaik, it does not provide 
this kind of abstraction (for the same reason I suppose).
{quote}

As I know, there is no such abstraction in JSch. There are some 
[wrappers|https://svn.apache.org/repos/asf/pig/branches/plan/lib-src/shock/org/apache/pig/shock/SSHSocketImplFactory.java]
 for JSch on internet which extends {{java.lang.Process}}. But, to keep minumum 
dependency, I am not looking for an abstraction in 3rd party library level.

Thank you!

> is GitSshdSessionProcess class Git specific? 
> -
>
> Key: SSHD-1243
> URL: https://issues.apache.org/jira/browse/SSHD-1243
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
>Reporter: dgü
>Assignee: Guillaume Nodet
>Priority: Major
>
> Hello!
> {{is org.apache.sshd.git.transport.GitSshdSessionProcess}} class Git specific 
> ?
> Is there a generic SSHD class extending java.lang.Process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1243) is GitSshdSessionProcess class Git specific?

2022-01-29 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet commented on SSHD-1243:
---

The {{GitSshdSessionProcess}} won't help you as you'd have to create the ssh 
session and channel, it's just a thin wrapper.  You just need the  
{{ChannelExec}} which will allow you to run a remote command, so just call the 
correct method on the {{{}ClientSession{}}}:

  
[https://github.com/apache/mina-sshd/blob/da2958172281ef20e51681afe036bd42c9cf843a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientSession.java#L182]

The reason why there's no abstraction is that you need to configure the SSH 
layer: host, port, user, password, ssh private key, host entries, ciphers, 
macs, etc...  So we probably won't provide such a thing.

And if you think you really need the {{GitSshdSessionProcess}} class, just copy 
it, rename it, and hack it to suit your needs.

Btw, you're saying you're migrating from {{Jsch}} but afaik, it does not 
provide this kind of abstraction (for the same reason I suppose).  However, it 
provides a {{ChannelExec}} in the same way as SSHD ...

> is GitSshdSessionProcess class Git specific? 
> -
>
> Key: SSHD-1243
> URL: https://issues.apache.org/jira/browse/SSHD-1243
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
>Reporter: dgü
>Assignee: Guillaume Nodet
>Priority: Major
>
> Hello!
> {{is org.apache.sshd.git.transport.GitSshdSessionProcess}} class Git specific 
> ?
> Is there a generic SSHD class extending java.lang.Process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1243) is GitSshdSessionProcess class Git specific?

2022-01-29 Thread Jira


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

dgü commented on SSHD-1243:
---

Hello!

I am trying to move from JSch to Apache Mina SSHD.

I want to use the SSH library as a java service provider. SSHD SFTP file system 
provider worked fine at SSHD-1238.

Now, i am testing remote command execution. But, it looks there is no 
abstraction in Java for command execution at SSHD-1242.

So, i must develop my own abstraction and a wrapper for SSH. It needs something 
like {{SSHDProcess}} extending {{java.lang.Process}}.

If i am not wrong, {{GitSshdSessionProcess}} is not inluded in ssh-core and 
sshd-common jar files. It is included sshd-git jar.

Do you have a plan a renamed class like {{SSHDProcess}} in more generic 
ssd-core, sshd-common, etc. jar files? It may be useful for environments which 
don't need Git with an additional jar, but need an SSHD extension to 
{{java.lang.Process}}.

This would be useful for minimum dependency in development and deployment.

Thanks in advance! 

> is GitSshdSessionProcess class Git specific? 
> -
>
> Key: SSHD-1243
> URL: https://issues.apache.org/jira/browse/SSHD-1243
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
>Reporter: dgü
>Assignee: Guillaume Nodet
>Priority: Major
>
> Hello!
> {{is org.apache.sshd.git.transport.GitSshdSessionProcess}} class Git specific 
> ?
> Is there a generic SSHD class extending java.lang.Process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1243) is GitSshdSessionProcess class Git specific?

2022-01-29 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet commented on SSHD-1243:
---

It's not really git specific but definitely SSHD specific.

You can try to reuse it if you want, but there's nothing in the SSHD code that 
will provide the magic you're looking for executing remote command.

I suggest you read the doc at 
[https://github.com/apache/mina-sshd/blob/master/docs/client-setup.md#running-a-command-or-opening-a-shell]
 and try building a small test with the plain SSHD api using the 
{{{}Session.createExecChannel{}}}, you'll also find some examples at 
https://github.com/apache/mina-sshd/blob/da2958172281ef20e51681afe036bd42c9cf843a/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java.

> is GitSshdSessionProcess class Git specific? 
> -
>
> Key: SSHD-1243
> URL: https://issues.apache.org/jira/browse/SSHD-1243
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
>Reporter: dgü
>Priority: Major
>
> Hello!
> {{is org.apache.sshd.git.transport.GitSshdSessionProcess}} class Git specific 
> ?
> Is there a generic SSHD class extending java.lang.Process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org