Thanks for both of you first. 
My question was, would it be best practice to hold the connection open as a 
member in my class, close it while all ends. 
Or - each time I need to execute something, to open --> execute --> close. A. 
Would this wouldn't be better ? 
B. if I will do it as I said In A, can it or do you expect to have issues ? 

-----Original Message-----
From: Claude Warren <[email protected]> 
Sent: Sunday, May 26, 2019 11:56 PM
To: [email protected]
Subject: Re: sshd-mina

While Alon Bar-Lev is correct, I have had cases where when an illegal command 
was sent to a remote end it closed the connection.  Be aware that there are 
edge cases that may impact your application where the connection will get 
closed.

Claude

On Sun, May 26, 2019 at 8:05 PM Alon Bar-Lev <[email protected]> wrote:

> Hi,
> Always prefer keys over passwords when interacting with remote servers.
> You can reuse the session, aka keep it as a member.
> You should close the session yourself.
> You can find a simplified example here[1].
> Regards,
> Alon
>
> [1]
>
> https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modu
> les/uutils/src/main/java/org/ovirt/engine/core/uutils/ssh/SSHClient.ja
> va
>
>
> On Sun, May 26, 2019 at 9:57 PM Dor Ben Dov <[email protected]>
> wrote:
>
> > Hi Everyone,
> >
> > At the moment I have a method to 'init' the user/password etc with 
> > the connect method of sshclient.
> > And I have different method where I do the executeremotecommand.
> >
> > In the code I am doing connect and then executeremotecommand in 
> > several places / methods etc.
> >
> > My question - the right way of work will be to open the session 
> > once,
> keep
> > it let's say as a member in the class And use it everywhere ?
> >
> > What about closing the session, am I responsible on closing the session ?
> >
> > Regards,
> > Dor
> > This email and the information contained herein is proprietary and 
> > confidential and subject to the Amdocs Email Terms of Service, which 
> > you may review at 
> > https://www.amdocs.com/about/email-terms-of-service < 
> > https://www.amdocs.com/about/email-terms-of-service>
> >
>


--
I like: Like Like - The likeliest place on the web <http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
This email and the information contained herein is proprietary and confidential 
and subject to the Amdocs Email Terms of Service, which you may review at 
https://www.amdocs.com/about/email-terms-of-service 
<https://www.amdocs.com/about/email-terms-of-service>

Reply via email to