New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom regexes and allow for delicate SSH servers #468

Merged
merged 6 commits into from Mar 9, 2018

Conversation

Projects
None yet
2 participants
@Red-M
Member

Red-M commented Feb 23, 2018

Patch that allows setting some custom regexes for pxssh and allows pxssh to be more gentle with target SSH servers and the shells they spawn.

This is for #451

Please let me know if I need to change anything in regards to docs or comments and those requests will be handled.

Red-M added some commits Feb 23, 2018

Patch that allows setting some custom regexes for pxssh and allows px…
…ssh to be more gentle with target SSH servers and the shells they spawn.
@Red-M

This comment has been minimized.

Member

Red-M commented Mar 9, 2018

Is there an issue with this PR @takluyver ?

I have to monkey patch this to fix devices that include "password" in the MOTD after a successful login.

@takluyver

This comment has been minimized.

Member

takluyver commented Mar 9, 2018

Sorry, I just hadn't looked at it. I've never used pxssh myself, so I tend to drag my feet on PRs for it, just because it doesn't interest me much.

Does PR #452 help to avoid issues with "password" appearing in the MOTD? It sounds like @orulz was running into the same thing.

options={}, encoding=None, codec_errors='strict'):
options={}, encoding=None, codec_errors='strict',
password_regex='(?i)(?:password:)|(?:passphrase for key)',
disable_original_sync=False):

This comment has been minimized.

@takluyver

takluyver Mar 9, 2018

Member

Style point: I prefer to avoid negative boolean parameters like disable_foo, unless there's a clear reason that the negative makes sense.

Looking at the rest of this class, I think the parameter fits better in the login() method (which already has parameters affecting syncing and changing the prompt). I'd probably just call it sync_original_prompt.

if self.disable_original_sync:
return(True)

This comment has been minimized.

@takluyver

takluyver Mar 9, 2018

Member

Also, rather than making the method a no-op, let's check it in login() and skip calling the method.

@Red-M

This comment has been minimized.

Member

Red-M commented Mar 9, 2018

This all seems fine to me.

@Red-M

This comment has been minimized.

Member

Red-M commented Mar 9, 2018

While PR #452 does fix it, for some reason this was reverted due to other devices not matching the password prompt (iirc, brocade devices).

I made this PR because devices like PFsense have password in the custom shell script that the devices spawns on login (it is also the reason to disable sync_original_prompt because sending a newline also counts as a 0 which is to exit/logout).

So I figured I might as well write something to fix both.

@Red-M

This comment has been minimized.

Member

Red-M commented Mar 9, 2018

Sorry, I just hadn't looked at it. I've never used pxssh myself, so I tend to drag my feet on PRs for it, just because it doesn't interest me much.

Do you need someone to look after pxssh a bit more?

I've used pxssh quite a lot for an extensive amount of time.

@takluyver

This comment has been minimized.

Member

takluyver commented Mar 9, 2018

Thanks, this looks good now. :-)

Having a maintainer who's more familiar with pxssh would certainly be good. If you're interested, would you mind sending us (the current maintenance team is myself, @jquast and @MountainRider ) a bit of information about yourself, so we know who we're trusting.

@takluyver takluyver merged commit b9e793a into pexpect:master Mar 9, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 88.871%
Details
@Red-M

This comment has been minimized.

Member

Red-M commented Mar 9, 2018

Let me know where and what to send. :)

@takluyver

This comment has been minimized.

Member

takluyver commented Mar 9, 2018

You can post here if you're happy to do it in public, or use the email addresses on our Github profiles.

As for what, there's no fixed list, I'd just like to have an idea who you are. What's your name? Where do you live (roughly - I don't need an address)? How do you come to be using pxssh a lot? What else are you interested in or working on?

@Red-M

This comment has been minimized.

Member

Red-M commented Mar 9, 2018

I'll send an email around.

Thanks!

@takluyver

This comment has been minimized.

Member

takluyver commented Mar 9, 2018

@MountainRider my email to your technicolor.com address bounced. Do you have another address we should use now?

@takluyver

This comment has been minimized.

Member

takluyver commented Mar 16, 2018

There were no objections, so I've added @Red-M on GitHub. Welcome to Pexpect maintenance! 🍪

@Red-M

This comment has been minimized.

Member

Red-M commented Mar 17, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment