Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 694
  • Last Modified:

Opening a SSH (Tunnel) Connection from Access - PUTTY.exe

I have a Access 2k3 database that uses an ODBC Connection to a MYSQL database, Thanks to some experts at experts-exchange that works great.  Unfortunately, in order to access the MySQL server I have to open a SSH connection via Putty.exe.  Due to timeout issues, just leaving the connection open is not good enough.  I am looking for a command line code or Shell command that I can use thru VBA  or bat file to open the connection, pass the user name and password.

I am trying to setup a scheduled task that will run in the middle of the night and this is my only obstacle.

Thanks,

Karen
0
Karen Schaefer
Asked:
Karen Schaefer
  • 2
1 Solution
 
omgangCommented:
I'm not sure how Putty.exe works but here's what I use to ftp webpages from within Access

I create a batch file to call the ftp program

ftp.exe -s:c:\FOLDER\spec_FOLDER.txt

I name the file ftp_FOLDER.bat

The ftp command is calling a specification file named spec_FOLDER.txt

open www.website.com
username
password
bin
put c:\FOLDER\webpage_index.htm index.htm
put c:\FOLDER\991515.html
put c:\FOLDER\991515_hold.html

Close


Bye

I have a scheduled task set to run how ever often the client wishes.  The task calls an Access application with it's Autoexce macro set to run a function that kicks everything off.

to call the batch file from the Access function

varRet = Shell(rsCom!FilePath & "\" & strBatFileName, 1)

OM Gang
0
 
omgangCommented:
Here's a link to the Putty FAQ page
http://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html#faq-savedsettings

If it were me, I'd probably start by tying out the command line option
putty -ssh host.name

and

Secton 6.4 discusses calling a saved session
varRet = Shell(c:\path\to\putty.exe -load "mysession")

Try experimenting with a batch file that calls the exec (like above) and passing user and pass like in my sample ftp batch file.

Next, look at 4.3 re. embedding putty in another program.

OM Gang
0
 
Karen SchaeferAuthor Commented:
Thanks to everyones input unfortunately due to security issues at my office I will be unable to use any of theses suggestions.

Security will not allow me to  pass the private key or public key to the server.  This is final.  So I was force to give my code to the IT department to be run thru the use of PHP.

Thanks,
K
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now