Re: Using MINA sshd 2.2.0

2019-10-16 Thread Vijay Shanker Dubey
Hi Prajwal,

Did you see and try something like this?

https://mina.apache.org/sshd-project/tips.html

---
*Thanks & Regards*,
Vijay Shanker |*Software Architect*


On Wed, Oct 16, 2019 at 9:15 PM Prajwal M  wrote:

> Hi All,
>
> I am currently trying to migrate from JSCH to MINA sshd api's
>
> Can you guys please let me know if there is any documentation about how
> to migrate to MINA (mapping jsch to MINA api's)
>
>
> As of now I am trying to execute a simple command /bin/uname and get its
> out put
>
> as below
>
>   try (ChannelExec channel = session.createExecChannel(command)){
>Trace.out("opening the exec channel");
>channel.open().awaitUninterruptibly();
> //channel.setStreaming(ClientChannel.Streaming.Sync);
>Trace.out("Streaming : " +
> channel.getStreaming().toString());
>
> InputStream in = channel.getInvertedOut();
> < get some object for which buffer
> is never ready
> InputStreamReader inStream = new InputStreamReader(in);
>   BufferedReader bufReader = new BufferedReader (inStream);
>  boolean isBufReady = bufReader.ready();
> <- buffer is never ready
> if (isBufReady)
>  {
> thisLine = bufReader.readLine();
> if ((thisLine != null) && (!"".equals(thisLine)))
>Trace.out ("read line is " + thisLine);
>}
>
>}
>
>
> But I am unable to get the output in any of the streams getInvertedOut
> and getIn
>
> getIn always returns null
>
>
> The purpose here is that we should be able to handle the cases
>
> 1] normal command execution and get the output
>
> 2] If the command propmts for a password we should be able to write it
> and then get the output.
>
> 3] execute with key based authentication.
>
>
> Please throw dome light on how to handle the Input and output streams
> while using the MINSA sshd API's
>
> Speedy response would be appreciated.
>
> Thanks
>
> Prajwal
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
> For additional commands, e-mail: dev-h...@mina.apache.org
>
>


Connecting to a sever via proxy server?

2019-10-07 Thread Vijay Shanker Dubey
 Hi,

I have an project in hand that need to upload files to a remote server. I
have done and prepared code to update the files and it is working fine. But
in some other environment; target remote server is only accessible via
proxy configuration. This makes my program fail.

So, Is it possible to connect to a remote server via '*sshd-sftp*' library?
If Yes, could you please give me some pointer to the documentation for the
same.

---
*Thanks & Regards*,
Vijay Shanker |*Software Architect*