oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Ssh extraction

Open MajesticFalcon opened this issue 7 years ago • 9 comments

On May 7, 2017, at 5:54 AM, ytti <[email protected]mailto:[email protected]> wrote:

Thanks! You've put lot of work into this, but I'm not currently in position to test it. Perhaps @ElvinEfendihttps://github.com/ElvinEfendi or @danilopopeyehttps://github.com/danilopopeye

I've not read the extracted library code at all, but in the ssh.rb client using the library, at least #send is broken, and #cmd appears no longer to support expect but rely on execworking, which is true for minority of our models. I feel like there is still duplication and role-overwrap, like exec and disconnect

This was just short 5min review, sorry.

I have addressed each point except the 'exec' one. Any ideas?

MajesticFalcon avatar May 17 '17 03:05 MajesticFalcon

#cmd is still broken, right? It doesn't not support expecting string as an end-of-output, but mandates use of exec channel?

Lot of devices I've tested do not support exec channels or support them incorrectly. IOS, IOS-XE and IOS-XR for example disconnect the whole SSH session after exec channel exits, requiring you to reconnect for every command. IOS-XR issue probably will be remedied in the 64b XRe, where SSH daemon should be changed to OpenSSH.

ytti avatar May 17 '17 08:05 ytti

@ytti Check out the library! Specifically how the expectation_handler works! It is somewhat confusing to you because I am using your variable names with my code. Don't think of cmd as exec. They are not the same. cmd now calls SSHWrapper#exec with makes a decision on whether or not to request shell or exec channel

MajesticFalcon avatar May 17 '17 20:05 MajesticFalcon

K understand it now.

ytti avatar May 18 '17 08:05 ytti

@danilopopeye @ElvinEfendi If I brought this into compliance with the current branch, would you mind checking it over? I know everybody is super busy, but this functionality would be amazing for users

MajesticFalcon avatar Sep 30 '17 03:09 MajesticFalcon

@MajesticFalcon I'd be happy to review. What's the general overview of why this PR was submitted in the first place?

laf avatar Nov 09 '17 22:11 laf

@laf Multiple reasons. SSH custom functionality shouldn't be a role of the main Oxidized. But for users likes me, I would love to use this SSH functionality in other scripts we use internally. It's ability to handle expect, tty, etc is currently difficult to come by.

MajesticFalcon avatar Jan 05 '18 05:01 MajesticFalcon

I fully support that we actually should have

a) library to interact with networking deices b) configuration backup software using that library (now oxidized) c) scriptable CLI using that library (now oxidized-script)

the way oxidized script is now done is rather hacky. This separation is part of what I consider necessary in the issue where I've listed things rewrite would need.

ytti avatar Jan 05 '18 09:01 ytti

@ytti so is this something you'd be happy to merge? Or is it something you'd want as an entire rewrite?

laf avatar Jan 06 '18 20:01 laf

any news on this?

mortzu avatar May 13 '22 19:05 mortzu