Solved

c# ssh tunnel with plink

Posted on 2014-11-26
4
422 Views
Last Modified: 2015-02-16
I have a C# web application that runs on Windows Server 2008 r2 and .NET 4. I have an SSH tunnel set up that runs via plink and stays running via AlwaysUp.

This web app was previously running on Win2k Server with .NET 1.1 and the tunnel would stay open as long as the server was running.

However, I've noticed now on the new server the web app can not maintain the connection. If I touch the web.config file the web app can use the connection and all is well. However, after about 2-3 minutes the connection is still alive on the server, but the web app won't connect until I touch the web.config again.

I'm not much of hardware person so I'm hoping maybe there is a setting on the server or within the web app that I am missing or something has changed in .NET idk I'm at a loss.
0
Comment
Question by:YPU
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Expert Comment

by:David
ID: 40469933
Not my area, yet I wonder why you use plink (for batch-style commands); and at least for the other SSH connections I can set a keepalive parameter in my host's ssh_config.  HTH
0
 
LVL 29

Expert Comment

by:serialband
ID: 40474908
With Openssh, you could supply the "-o ServerAliveInterval=120" when you call the command.  Unfortunately, plink doesn't allow options to be passed through.  You'll have to set it in your config file.

Run the following to add the interval to your account's client configuration file.
echo "ServerAliveInterval 120"  >>  ~/.ssh/ssh_config
0
 

Accepted Solution

by:
YPU earned 0 total points
ID: 40603754
I solved this issue on my own. I found that I was not properly closing the connection to the mysql database and there were too many connections to the db, causing the db to disallow any new connections. I patched the code and restarted the db and all is well.
0
 

Author Closing Comment

by:YPU
ID: 40611886
Problem solved. Make sure the database you are trying to connect to has available connections.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question