-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Implement streamlocal-forward for remote => local UDS forwarding #312
Conversation
I seem to have implemented most if not all of the needed behavior (but not tests yet), but this needs thorough review by people who know the library better than me. |
@Eugeny would really appreciate it if you took a look |
I'm pretty sure I handled the reserved field correctly, but not completely sure |
I think you can go ahead and try it out :) looks mostly fine so far |
I'll try by including the crate by path, hope it works |
Update: it doesn't work :( RequestDenied, gonna try to investigate. Definitely my fault since |
|
Well |
@Eugeny Makes no sense, where's the issue here? Impl: push_packet!(enc.write, {
enc.write.push(msg::GLOBAL_REQUEST);
enc.write
.extend_ssh_string(b"[email protected]");
enc.write.push(want_reply as u8);
enc.write.extend_ssh_string(socket_path.as_bytes());
}); Spec:
|
@Eugeny While testing this, I also tested tcp/ip forwarding with |
So it seems forwarding generally is completely broken. |
@Eugeny Considering forwarding is broken, I'm pretty sure making it work is not as simple as just sending global messages to enable/cancel forwarding over SSH. My brain is too smooth to understand openssh's code, but I suppose what they're doing is not just making these global requests (which russh is capable of doing correctly, with some caveats), but also actually binding to these sockets itself and proxying all traffic over. Unfortunately, there is little reference aside from openssh C code (which I'll still try to dig into sometime) about how exactly this is done, since openssh is one of the only implementations of ssh that actually support forwarding. |
@Eugeny Have you tested whether this actually works after your fixes? Sorry for abandoning the PR |
Fixed a few issues and now it works:
|
No worries! It works with simple client & server examples - but I just tested it briefly |
* docs: update pdocs docs: fixed link * fix: fmt
I left a
// NEED HELP
comment on places where I didn't fully figure out what to do, so I'd really appreciate it if some maintainers helped me out in those places.