Random local port (General questions)
While defining tunnels, is it possible to not choose a local port, and have the wodtunnel randomly pick an unused port to bind to?
While defining tunnels, is it possible to not choose a local port, and have the wodtunnel randomly pick an unused port to bind to?
by Jasmine, (7640 days ago) @ Chad Amberg
Chad,
this already works. Set LocalPort to 0, and then in ChannelStart read it's value to see what port we assigned.
Regards.
by Chad Amberg , (7639 days ago) @ Jasmine
Chad,
this already works. Set LocalPort to 0, and then in ChannelStart read it's value to see what port we assigned.
Regards.
Sweet! This makes things a lot easier on my side!
by Chad Amberg, (6952 days ago) @ Chad Amberg
Chad,
this already works. Set LocalPort to 0, and then in ChannelStart read it's value to see what port we assigned.
Regards.
Sweet! This makes things a lot easier on my side!
by Chad Amberg, (6952 days ago) @ Chad Amberg
I'm starting a RemoteListen tunnel. And I need it to pick a random port on the remote side. Is there any way to tell what that remote port is chosen after the channel is connected? Essentially I'm adding the channel using a 0 for the RemotePort, but afterwards I need to know what port it is.
by woddrazen , (6952 days ago) @ Chad Amberg
Hi Chad,
Here is example which will show you what channel is started after you make RemoteListen Connection:
-------------------------
Dim i As Integer
For i = 0 To SSH_1.Channels.Count - 1
Debug.Print SSH_1.Channels(i).RemotePort & = & SSH_1.Channels(i).Activated
Next i
-------------------------
Hope I helped.
Regards,
Drazen
by Chad Amberg, (6951 days ago) @ woddrazen
Hi Chad,
Here is example which will show you what channel is started after you make RemoteListen Connection:-------------------------
Dim i As IntegerFor i = 0 To SSH_1.Channels.Count - 1
Debug.Print SSH_1.Channels(i).RemotePort & = & SSH_1.Channels(i).Activated
Next i
-------------------------Hope I helped.
Regards,
Drazen
Hi Drazen-
If I open up a connection saying that the remote port is 0, because we can't know what port is available ahead of time, your debug output above always shows port 0.
However, the server does open up a random port correctly.
Looking at http://www.ietf.org/rfc/rfc4254.txt for the SSH_MSG_CHANNEL_OPEN_CONFIRMATION message, it does seem that when the server replies, that it includes both sides of the channel information. Of course, I've never debugged what the actual SSH conversation looks like, but I'm hoping that you can tell me that after a tunnel is opened, that the server does respond with the port information, and that this can be added to wodtunnel hopefully?
Thanks,
Chad
by Chad Amberg, (6951 days ago) @ Chad Amberg
Whups, wrong message. Looking at the right section of the RFC, part 7.1:
If a client passes 0 as port number to bind and has 'want reply' as
TRUE, then the server allocates the next available unprivileged port
number and replies with the following message; otherwise, there is no
response-specific data.
byte SSH_MSG_REQUEST_SUCCESS
uint32 port that was bound on the server
by Jasmine, (6951 days ago) @ Chad Amberg
Chad,
I have double checked - we do accept SSH_MSG_REQUEST_SUCCESS and read it's value, and is stored to RemotePort property.
Kreso
by Chad Amberg, (6950 days ago) @ Jasmine
Chad,
I have double checked - we do accept SSH_MSG_REQUEST_SUCCESS and read it's value, and is stored to RemotePort property.
Kreso
Hi Kreso-
Strange, I read the remote port continuously and only ever see a remote port of 0.
Could this be because the SSH server is reporting back a 0? I can go bug WinSSHD also on this...
by Jasmine, (6950 days ago) @ Chad Amberg
Chad,
it is very possible that server implementations don't work as that specification. Most of them were made on older draft which did not send port value with SSH_MSG_REQUEST_SUCCESS message.
I'll change wodSSHServer and freeSSHd now, can't say for others. wodSSHTunnel *IS* ready for this and should work as is.
Kreso
by Jasmine, (6950 days ago) @ Jasmine
Actually I was wrong. There was a bug in wodSSHTunnel. It's not fixed. Grab newest version and try it out.
Kreso
by Chad Amberg, (6950 days ago) @ Jasmine
Actually I was wrong. There was a bug in wodSSHTunnel. It's not fixed. Grab newest version and try it out.
Kreso
Just tried build 1.52.49 and I still get the same results.
I'm just doing a real simple function to check:
Private Sub ssh1_ChannelStart(ByVal Chan As wodSSHTunnelServLib.Channel) Handles ssh1.ChannelStart
Dim chanInfo As String =
chanInfo = Secure Channel Opened
chanInfo = chanInfo & vbCrLf & Channel: & Chan.Name
chanInfo = chanInfo & vbCrLf & Local Address: & Chan.LocalAddress
chanInfo = chanInfo & vbCrLf & Local Port: & Chan.LocalPort
chanInfo = chanInfo & vbCrLf & Remote Address: & Chan.RemoteAddress
chanInfo = chanInfo & vbCrLf & Remote Port: & Chan.RemotePort
writeToLog(EventLogEntryType.Information, chanInfo, 2)
end sub
So this should show up as soon as the channelstart event, correct?
by Jasmine, (6950 days ago) @ Chad Amberg
Yes, on channel start. What server do you use? I tested with wodSSHServer which I *know* it works (because I just made it by the specs...)
Kreso
by Chad Amberg, (6950 days ago) @ Jasmine
Latest greatest version of WinSSHD. I've sent Bitvise an email to make sure they're up to spec to but haven't heard a response back yet.
Does the current build of freesshd available work?
by Jasmine, (6950 days ago) @ Chad Amberg
Chad,
don't know about freeSSHd, you have to post question there.
Kreso
by Chad Amberg, (6944 days ago) @ Jasmine
Just an FYI to all...
The ssh server from VanDyke software called VShell does support this and it works really well.
Brilliant, even works on the mobile phone...
WeOnlyDo!COM will be the first stop I make should I require any further off-the-shelf components.
We are having great success with your component ... email server that has over 750 000 mailboxes back ended by a SQL server...
...with a minimum of effort as the DLL interface was written with such simplicity...
The people at WeOnlyDo are amazing! ... I always get a super fast response from customer service, and the products are great too. Thanks WeOnlyDo
Just thought you'd like to know that my gateway app with your SMTP Server component held the line against a DDOS attack today...
You made it so simple for us to integrate SFTP - a technology we had little experience with...
Count us as a satisfied WeOnlyDo customer. We appreciate your terrific support to get the secure Telnet working properly.
I've heard that you are amazing with your replies coming back so quickly - and now I've seen the speed in which you reply first hand.
We have recently completed a large 1200+ location project where reliable Telnet and SSH connectivity was required. wodSSH worked flawlessly and allowed our staff to complete our project ontime and within budget.