-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
ssh-chat defaults to IPv6, even when IPv4 listening address is specified #139
Comments
Hmm so it's not bindable from 0.0.0.0:2022 locally? That's frustrating. Honestly not sure what the problem is here, would appreciate any help with debugging. :) |
I have found the same problem. But apparently, you need to create a net.Listener separately. The http package's ListenAndServe functions are for convenience, and are not a complete solution.
|
So I've changed line 19; https://github.com/shazow/ssh-chat/blob/master/sshd/net.go
|
Can anyone confirm if this is still a problem with v1.1? Check the latest binary release here: https://github.com/shazow/ssh-chat/releases Please re-open the issue if its. |
@shazow @zachyordy I believe that this issue is related to this Golang issue. However, it is closed and some people still may want ssh-chat listen on IPv4 network only. Currently it seems that the only option is to manually change the network to |
@iamdavidcz Thanks for the note. Could you expand on your scenario which requires to only use IPv4? This will help inform me how to best design the UX to accommodate. :) |
@shazow Getting through above comments I can notice that some users may want use IPv4 only, but I don't know their exact scenarios and use cases. Maybe they just don't use IPv6 and binding to it by default may cause serious vulnerabilities. But that's just my guess :) |
@shazow And it seems like ssh-chat is not the only project that has this issue: I can see two options here. The first one (probably easier) is adding |
I agree about the options but I don't want to speculate on the scenario, adding features blind like this can cause more harm than good. :) There are often alternative approaches once a scenario is revealed. I appreciate you doing the research. If this issue does not affect you specifically, then let's punt on it until someone else shows up with a scenario they're dealing with. |
@shazow Let me get this as straight as possible: I believe that the current behavior is a bug and should be fixed. Passing
|
@iamdavidcz I understood what you said. If you're looking to fix this regardless of how it affects ssh-chat usecases, then you want to take it upstream: https://github.com/golang/crypto/blob/3c4aac89819a5fdc28d906456729d3423fd46969/ssh/tcpip.go#L24 |
A non-breaking fix I'd consider here is maybe an optional |
@shazow Yes, we definitely should improve logging as it is wrong too:
But first of all, can we reopen this issue? |
Quite frankly, I'm not 100% sure what's going on here. When I specify to bind to 0.0.0.0:2022, the output shows that it is When I check netstat, it only shows that the ssh-chat program is listening on tcp6:
However, when I try to actually connect to the host using IPv4, it works. The two things to fix in my mind would be:
|
@zachyordy As I mentioned before, when you specify to bind to |
#348 here's an open issue for you, appreciate you volunteering on this. |
@shazow Why did you create a new issue instead of reopen this one? Once again (and hopefully the last one): the root of the issue is not logging, but the fact that ssh-chat listens on both IPv4 and IPv6 whereas it should listen only on IPv4. The log output is incorrect too (should be |
In fact it will trying to bind to an IPv6 address even IPv6 is disabled in entire system (no IPv6 address is configured), resulting in an error, even if something like
The workaround is to bind to a valid IPv4 address other than
|
I don't see ssh-chat listening on IPv4. Is there a way to make this happen?
The text was updated successfully, but these errors were encountered: