LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-15-2007, 04:31 PM   #1
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Rep: Reputation: 31
Connect to server share from different subnet. Samba?


Ok, here is what I want to do. I wrote a script that backs up my email mbox's and www sites. It creates several .tar.gz files and then moves them to a directory on my server. Now what I want to be able to do is download those .tar.gz file to one of my WinXP workstations. My XP workstations are on a 192.168.1.0/24 network while my server is on a 10.10.11.0/24 network (hardware based firewall separates the two machines). Obviously, I know I could simply FTP into the server and download the files that way, but what I would like to do is write some type of script (or .bat if I have to do it from XP) that automatically grabs those backup files daily.

Now if the machines where on the same subnet, I could easily create a share to that "backup" directory on my server and simply moves the .tar.gz files across. But since I'm on a different subnet I'm guessing I can't do this. Correct?

Just looking for some input. Any ideas?? Can samba be used to do this or do I need something else??
 
Old 03-16-2007, 10:49 AM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
A Couple of Issues

1. It sounds like your web server is in a DMZ. (it should be anyway) Please confirm.

2. I don't like punching holes in the dmz to do what you want so I would set up ssh access to your web server, then do sftp with plink using the web server's public IP/DNS address. (plink.exe should be included with putty if you download the entire installer)

3. I'm a security nut, so I use public keys to access my ssh/sftp and move sshd to another port. Make sure whatever port you use is open on your firewall. If you stay with default port 22 you will be hammered by script kiddies.
 
Old 03-16-2007, 11:31 AM   #3
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Original Poster
Rep: Reputation: 31
Hey mpapet1!

Quote:
Originally Posted by mpapet
1. It sounds like your web server is in a DMZ. (it should be anyway) Please confirm.
This is correct. I actually have three networks (well 4 if you count my public IP from my DSL provider) One for my public wifi, one for my server, and one for my lan. M0n0wall (hardware based firewall) handles all routing between the networks. NOTHING is allowed (from the net) into the LAN or Wifi networks. Only SSH, http, POP3, and SMTP are allowed into the server network via NAT. (FTP is currently not allowed in from the net)

Quote:
2. I don't like punching holes in the dmz to do what you want so I would set up ssh access to your web server, then do sftp with plink using the web server's public IP/DNS address. (plink.exe should be included with putty if you download the entire installer)
This is what I thought I was going to have to do. Since I already have SSH setup, I just need to get sftp on the windows machine that I want to sftp into the server with. The Putty I have only lists, "RAW", "Telnet", "Rlogin", and "SSH" as protocols. While I'm not familiar with sftp, I'm assuming it is tunneling ftp traffic via SSH, correct? So nothing additional needs to be setup on the server other than SSH and FTP, correct?

Quote:
3. I'm a security nut, so I use public keys to access my ssh/sftp and move sshd to another port. Make sure whatever port you use is open on your firewall. If you stay with default port 22 you will be hammered by script kiddies.
I have had port 22 open FOREVER on my firewall so that I can SSH in. Maybe I should rethink that...

Now I have to figure out a way to automate all of this. I really don't want to have to manually do this every day...
 
Old 03-16-2007, 01:24 PM   #4
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Automating

1. You should have plink.exe in the same install folder as your putty.exe. You should be able to use plink in a script to do the work for you.

2. If you have ssh already running, sftp kind of sits on top of ssh, so an sftp client should be all that is needed. I don't remember this perfectly, so look into it some more.

3. It's obvious you aren't reading your logs if you have kept ssh on port 22. How do you know what's happening on your DMZ'd servers?

4. I use perl on win32 for scripting. I recommend strawberry-perl because it uses a GPL dmake for the entire distro. Decent/Good cpan compatibility. Certainly better than activestate's.
 
Old 03-16-2007, 02:40 PM   #5
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by mpapet
1. You should have plink.exe in the same install folder as your putty.exe. You should be able to use plink in a script to do the work for you.

2. If you have ssh already running, sftp kind of sits on top of ssh, so an sftp client should be all that is needed. I don't remember this perfectly, so look into it some more.

3. It's obvious you aren't reading your logs if you have kept ssh on port 22. How do you know what's happening on your DMZ'd servers?

4. I use perl on win32 for scripting. I recommend strawberry-perl because it uses a GPL dmake for the entire distro. Decent/Good cpan compatibility. Certainly better than activestate's.
Just checked my log files for the first time in, I don't know... Years maybe... Looks like I was hit with a scanner out of China trying everyname and pass in the book on my sshd. Maybe it is time for a port change... :-)

Thanks for the help. I'll see about scripting some kind of automatic ftp transfer.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to XP share from samba debian flycast Linux - Software 2 11-27-2006 09:50 PM
cant connect to the server from the same external subnet cccc Debian 5 03-07-2006 02:34 PM
Trying to get system on different subnet connect to Samba nbccbn Linux - Networking 2 07-14-2005 07:46 AM
Can't connect to Samba share outside of subnet digitalghost Linux - Software 0 04-01-2004 11:52 AM
How to connect to a server with a subnet address? lostboy Linux - Networking 10 07-05-2003 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration