Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 19th, 2005, 10:40 AM   #1
genxweb
Newbie
 
Join Date: Sep 2005
Posts: 10
Rep Power: 0 genxweb is on a distinguished road
VB ssh client with port fowarding

It has been years since i wrote any code but I am workign on a service where I need to have a application that will create a ssh session and alow be able to use port fowarding to create a secure tunnel to use the local ip of a server across the net. I know putty does this but I dont want the users seeing or changing setting so I figured If I could find a object or some sample code I may be able to do this. the client will be connecting to a linux ssh server that has squid proxy running on localhost. The ssh client will do port fowarding and all traffic for internet will then be routed through the proxy at the remote site. I have also added to this app a menu to auto configure ie and firefox as well as AIM. I jsut dont have the ability to code it to do the ssh part if any one has a link or some products preferably free that i can google it be much appreciated.
genxweb is offline   Reply With Quote
Old Sep 21st, 2005, 5:04 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
To establish any kind of network tunnel/bridge be it VPN or SSH you need a program running to actually relay the packets. VB is way to slow to do this (something like asm is more appropriate) and unless you're planning on controlling a separate engine written in another language or scripting the built in windows dial out your probably best writing this in another language!
If all you want to change is the gui, you could probably just modify putty.
Rory is offline   Reply With Quote
Old Sep 23rd, 2005, 10:59 AM   #3
genxweb
Newbie
 
Join Date: Sep 2005
Posts: 10
Rep Power: 0 genxweb is on a distinguished road
This is what I did. Putty has a command line application called plink. I dled that and used the shell /c to excute it with a vbhide. This worked great though I am now looking for a way to kill the plink.exe when the applciation ends, all the code snippets I have found are for 95 and 98 and wont work on xp. I am also looking for a way to send a command to the plink to have it ping the remote host every 3 minutes to keep connection alive.
genxweb is offline   Reply With Quote
Old Sep 25th, 2005, 11:34 AM   #4
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Quote:
Originally Posted by genxweb
This is what I did. Putty has a command line application called plink. I dled that and used the shell /c to excute it with a vbhide. This worked great though I am now looking for a way to kill the plink.exe when the applciation ends, all the code snippets I have found are for 95 and 98 and wont work on xp. I am also looking for a way to send a command to the plink to have it ping the remote host every 3 minutes to keep connection alive.
If you hold on to the return value of the shell, you have the PID, and can kill it with an API. In terms of keeping the connection alive, shelling "ping -n 1 -k x.x.x.x" every 3 mins, where x.x.x.x is the gateway for the VPN should do the trick.
Rory is offline   Reply With Quote
Old Sep 27th, 2005, 8:46 AM   #5
genxweb
Newbie
 
Join Date: Sep 2005
Posts: 10
Rep Power: 0 genxweb is on a distinguished road
Very nice I will have to play with that. I have the pid saved casue I use the pid to close the connection, so doing this should not be to hard.
genxweb is offline   Reply With Quote
Old Sep 27th, 2005, 2:07 PM   #6
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Quote:
Originally Posted by Rory
If you hold on to the return value of the shell, you have the PID, and can kill it with an API. In terms of keeping the connection alive, shelling "ping -n 1 -k x.x.x.x" every 3 mins, where x.x.x.x is the gateway for the VPN should do the trick.
Sorry, correction "ping -n 1 -k x.x.x.x www.google.com" - you need a destination host!
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:17 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC