DB Connection over SSH not working
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
Hello,
I can’t find out the correct syntax for port-forwarding. With PuTTY it works fine,
Process.Start("C:\Program Files\PuTTY\plink.exe", "-ssh <user>@<hostname> -pw <password> -P 22 -N -L <localport>:127.0.0.1:<destinationport>")
But if connected with this
Dim sshClient As New Renci.SshNet.SshClient(<hostname>, 22, <user>, <password>)
sshClient.Connect()
Dim port As Renci.SshNet.ForwardedPortLocal = New Renci.SshNet.ForwardedPortLocal("127.0.0.1", <localport>, <hostname>, <destinationport>))
sshClient.AddForwardedPort(port)
port.Start()
I’m getting a „Reading from the stream has failed.“-Error when opening the database connection afterwards. The sshClient.isConnected = True and port.isStarted = True. What is the correct way?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SshClient and ForwardedPortLocal usage shown in the issue, including the host, port, and port.Start() calls. Reproduce the reported database connection failure after the SSH client and forwarded port report connected and started. Done means identifying the correct forwarding setup or documenting the missing usage detail needed to avoid the stream error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100