Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 24th, 2005, 06:07 PM
teleute teleute is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 teleute User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 7 sec
Reputation Power: 0
Angry SSH tunneling from a shared web host

Here's my nightmare:

I'm gathering info on a web form that is hosted by a shared hosting provider. I want this information to go securely to a mySQL database on a server here at my office. This would best be done via an SSH tunnel, right? However, I'm not sure how to do an SSH tunnel, with no shell access to the shared hosting space. Since it's getting called from a script, I can't type in a password, and I can't run ssh-keygen. What other alternatives do I have?

Thanks.

Reply With Quote
  #2  
Old March 25th, 2005, 06:48 AM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 51 m 4 sec
Reputation Power: 21
I believe you can have a cgi copy the data to your other machine via ssh (scp, sftp, etc.) Be sure to make the account that communicates with your local server can only upload files to a single directory and can't execute anything at all (else your cgi could be hyjacked for use in penatrating your local computer).
__________________

Left DevShed May 28, 2005. Reason: Unresponsive administrators.
Free code: http://sol-biotech.com/code/.
Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.

It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw

Reply With Quote
  #3  
Old March 25th, 2005, 01:06 PM
teleute teleute is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 teleute User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by mitakeet
I believe you can have a cgi copy the data to your other machine via ssh (scp, sftp, etc.) Be sure to make the account that communicates with your local server can only upload files to a single directory and can't execute anything at all (else your cgi could be hyjacked for use in penatrating your local computer).


That would involve storing the data on the web server for some length of time before copying. I don't want it to ever be stored there - I want the form to directly pipe the data to us into our local mySQL database. It's credit card info, etc...so I don't want it hanging out on the server at all.

Reply With Quote
  #4  
Old March 25th, 2005, 01:14 PM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 51 m 4 sec
Reputation Power: 21
Why should that require ever writing it to disk? Each call of the CGI can make the connection to your local server and copy the data.

Reply With Quote
  #5  
Old March 25th, 2005, 03:24 PM
teleute teleute is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 teleute User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by mitakeet
Why should that require ever writing it to disk? Each call of the CGI can make the connection to your local server and copy the data.


Can SCP just copy over variables? I thought it copied files only.

Reply With Quote
  #6  
Old March 25th, 2005, 08:43 PM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 51 m 4 sec
Reputation Power: 21
The point I am trying to make is that secure communication has nothing to do with files. scp, sftp, etc. are all examples of applications. If you embed the secure communication code directly in your cgi then you can do whatever you want. Check out OpenSSL for a library that you should be able to include in your project.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > SSH tunneling from a shared web host


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT