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

Multiple SSH forwards don't work when specified with -L #185

Closed
bachya opened this issue Dec 30, 2016 · 3 comments
Closed

Multiple SSH forwards don't work when specified with -L #185

bachya opened this issue Dec 30, 2016 · 3 comments
Assignees
Labels

Comments

@bachya
Copy link
Contributor

bachya commented Dec 30, 2016

I have the following entry in my generated SSH config:

Host home
  User root
  # HostName: myhost.com

When I run this command (to forward multiple ports):

ssh -L 9998:localhost:22 -L 9999:localhost:22 home -N -v -v

(where ssh is aliased to assh wrapper ssh)

...I only see the last -L option specified in the output:

debug1: Local connections to LOCALHOST:9999 forwarded to remote address 192.168.1.121:22
debug1: Local forwarding listening on ::1 port 9999.
debug2: fd 6 setting O_NONBLOCK
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 9999.

I can confirm that when I use the system /usr/bin/ssh, both forwards are activated correctly.

This may be related to #119 – not sure.

@moul
Copy link
Owner

moul commented Dec 30, 2016

Ho @bachya, thanks for your feedback,

I just merged the PR #186 with a fix for your issue, can you try again ?

@moul moul closed this as completed in #186 Dec 30, 2016
@moul moul removed the in progress label Dec 30, 2016
@bachya
Copy link
Contributor Author

bachya commented Dec 30, 2016

Hi @moul – appreciate the quick turnaround! It looks like #186 fixes this; when I run the original command now:

ssh -L 9998:localhost:22 -L 9999:localhost:22 home -N -v -v

...I get both ports forwarded:

debug1: Local connections to LOCALHOST:9998 forwarded to remote address 192.168.1.121:9998
debug1: Local forwarding listening on ::1 port 9998.
debug2: fd 6 setting O_NONBLOCK
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 9999.
debug2: fd 7 setting O_NONBLOCK
debug1: channel 1: new [port listener]
debug1: Local connections to LOCALHOST:9999 forwarded to remote address 192.168.1.121:9999
debug1: Local forwarding listening on ::1 port 9999.
debug2: fd 8 setting O_NONBLOCK
debug1: channel 2: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 8088.

Thanks so much!

@moul
Copy link
Owner

moul commented Dec 31, 2016

Perfect :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants