Title: Let user handle keyboard-interactive events by MattCatz · Pull Request #192 · ParallelSSH/ssh2-python · GitHub
Open Graph Title: Let user handle keyboard-interactive events by MattCatz · Pull Request #192 · ParallelSSH/ssh2-python
X Title: Let user handle keyboard-interactive events by MattCatz · Pull Request #192 · ParallelSSH/ssh2-python
Description: Keyboard-interactive events can have multiple steps. Tweak the existing kbd_callback to massage prompts into a format that an end user can handle from python. New public method userauth_keyboardinteractive_callback added to the session class to maintain backwards compatibility. See new example script for usage. I didn't add any new test case since I'm not really sure how it would fit into the existing set-up. To test locally I set spun up a ssh server inside a docker container1 and pointed the example script at it. Below is an example command I used: OTP=$(oathtool --totp -d 6 12345678909876543210) python ./examples/keyboard_interactive_auth.py --host 127.0.0.1 --port 2022 -u sshuser $OTP 552099 hostname Example Dockerfile SSH server with MFA FROM debian:latest RUN apt-get update && apt-get install -y \ openssh-server \ libpam-oath \ oathtool \ && rm -rf /var/lib/apt/lists/* RUN groupadd sshgroup RUN useradd -ms /bin/bash -g sshgroup -p '$1$sshuser$TCmWDAEGpJ.Z.Sj/NN02I.' sshuser RUN echo 'HOTP/T30/6 sshuser - 12345678909876543210' > /etc/users.oath RUN chmod 600 /etc/users.oath RUN echo 'auth required pam_oath.so usersfile=/etc/users.oath window=30 digits=6' >> /etc/pam.d/sshd run cat /etc/pam.d/sshd RUN echo 'ChallengeResponseAuthentication yes \nKbdInteractiveAuthentication yes\n' >> /etc/ssh/sshd_config.d/otp.conf RUN service ssh start EXPOSE 22 CMD ["/usr/sbin/sshd","-D"] Footnotes ↩
Open Graph Description: Keyboard-interactive events can have multiple steps. Tweak the existing kbd_callback to massage prompts into a format that an end user can handle from python. New public method userauth_keyboardint...
X Description: Keyboard-interactive events can have multiple steps. Tweak the existing kbd_callback to massage prompts into a format that an end user can handle from python. New public method userauth_keyboardint...
Opengraph URL: https://github.com/ParallelSSH/ssh2-python/pull/192
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:6f791223-d9a6-0f98-2593-de20d0d19d02 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 988A:1D7F:6A663C:8592C3:697DAAC8 |
| html-safe-nonce | 6666b0c581cc9184c1e9f43248bd842e43cbf8f7f7913030554da4b64cbae1f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODhBOjFEN0Y6NkE2NjNDOjg1OTJDMzo2OTdEQUFDOCIsInZpc2l0b3JfaWQiOiIxMjA4MDg5MjgzMjU3MDE5MDgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 16218f0d06835ea4e13a5b72358b97604fbdbc085e2496168676cb37523af06c |
| hovercard-subject-tag | pull_request:1524008548 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/ParallelSSH/ssh2-python/pull/192/checks |
| twitter:image | https://avatars.githubusercontent.com/u/14895427?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14895427?s=400&v=4 |
| og:image:alt | Keyboard-interactive events can have multiple steps. Tweak the existing kbd_callback to massage prompts into a format that an end user can handle from python. New public method userauth_keyboardint... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/ParallelSSH/ssh2-python git https://github.com/ParallelSSH/ssh2-python.git |
| octolytics-dimension-user_id | 22918200 |
| octolytics-dimension-user_login | ParallelSSH |
| octolytics-dimension-repository_id | 98586974 |
| octolytics-dimension-repository_nwo | ParallelSSH/ssh2-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 98586974 |
| octolytics-dimension-repository_network_root_nwo | ParallelSSH/ssh2-python |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width