sshpiper: Cannot create upstream when client has multiple key pairs

Hi! I just saw this project today and wanted to try it out to reverse proxy my SSH servers. When using public key authentication, the server errors out if the incorrect private key is used by the client. I believe the normal behaviour seen in openssh server is either a “permission denied (publickey)” or allow the client to retry with a different key. Is there some kind of configuration I can use/enable to allow the normal behaviour?

Here is my YAML file

version: "1.0"
pipes:
  - from:
      - username: "user"
        authorized_keys: /home/user/sshpiper/keys/authorized_c1
    to:
      host: 127.0.0.1:5522
      username: "user"
      password: "pass"
      ignore_hostkey: true
  - from:
      - username: "user2"
        authorized_keys: /home/user/sshpiper/keys/authorized_c2
    to:
      host: 127.0.0.1:5422
      username: "user2"
      password: "pass"
      ignore_hostkey: true

and here is the command I used

./out/sshpiperd -i /tmp/sshpiperkey --server-key-generate-mode notexist --log-level=trace ./out/yaml --config config.yaml --no-check-perm

Thank you so much for this project by the way, it is the only functional SSH reverse proxy I’ve come across

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Nevermind fixed it, I looked at the known hosts parsing and it needs to contain the host IP as well in addition to pubkey

will support multiple key

--no-check-perm: you need to set yaml to 400 (chmod 400 xxx.yaml) ignore-hostkey: true: to have secure connection, need to put upstream hostkey.pub to known_hosts_data