Skip to content
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

[Feature] Any possibility for adding auto-2FA for ssh? #1652

Open
3 tasks done
EXGDT opened this issue Nov 13, 2024 · 0 comments
Open
3 tasks done

[Feature] Any possibility for adding auto-2FA for ssh? #1652

EXGDT opened this issue Nov 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@EXGDT
Copy link

EXGDT commented Nov 13, 2024

Verification Steps

  • I have read the documentation and confirmed that this feature is not implemented
  • I have searched for the feature request I want to propose in the Issue Tracker and did not find it
  • I am a non-Chinese user.

Description

Currently, if I want to connect to an internal server through a jump host and use it as part of the system proxy, I need to manually establish a local SOCKS5 proxy using ssh -D and then add it to mihomo proxy groups. The 2FA process can be automated with an Expect script or a modified version of sshpass, as long as the 2FA secret key is available. Of course, official software like Termius or MobaXterm doesn't allow 2FA automation, but I think Mihomo could easily support it. The ideal configuration file might look like this:

proxies:

  • name: "ssh-out"
    type: ssh

    server: 127.0.0.1
    port: 22
    username: root
    password: password
    private-key: key
    private-key-passphrase: key_password
    host-key:

    • "ssh-rsa AAAAB3NzaC1yc2EAA..."
      host-key-algorithms:
    • rsa
      2fa-settings:
      2fa-TOTP-shared-secret-key: "4LSI744DKVCDCJMXBCDYA1V3QE"
      2fa-one-times-password-prompt: "verfification code:"
      2fa-password-prompt: "password:"
@EXGDT EXGDT added the enhancement New feature or request label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant