Solved

c# ssh tunnel with plink

Posted on 2014-11-26
4
357 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
  • 2
4 Comments
 
LVL 23

Expert Comment

by:David
Comment Utility
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 27

Expert Comment

by:serialband
Comment Utility
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
Comment Utility
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
Comment Utility
Problem solved. Make sure the database you are trying to connect to has available connections.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
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.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now