LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-25-2011, 04:46 AM   #1
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Rep: Reputation: 1
Question proftp masquerading setup guide uses ipchains conver to iptables


I am having problems understanding this site here:

howto Nat

I wanted to be able to resolve something like ftp.myfirstdomain.com to 192.168.0.2

Then ftp.mysecond.com to 192.168.0.3

Just as a random example, I know these cannot be done using name based virtual hosts like in Apache.

But I got this working internally using my LAN connection and the 2 IP addresses above, with Bind DNS pointing the dns's to those 2 ip addresses respectively.

This worked, yet when I tried connecting from my work place to transfer some files, it kept going to the default user's home directory.

Can someone help me here?

Just wanted to get this project finished, 2 domains and one public facing IP address, can someone help?

Thanks in advance for any replies,
Jeremy.
 
Old 01-26-2011, 02:12 PM   #2
fcintron
Member
 
Registered: Oct 2010
Location: México
Distribution: Centos
Posts: 72

Rep: Reputation: 4
Please try to give us a better description of your configuration. I don´t understand what are you trying to do.

are you going to access two linux boxes inside a lan from another linux box inside another lan???

From what I am getting, you want to connect through your firewall to 2 linux boxes using ftp.

If you want to transfer files is better to use scp is more secure. Another advantage is that you could differentiate your connection to your first or second linux box using ip ports.

Inside your router you could configure your firewall to NAT port 22 to port 22 in linux box1. And to NAT port 2222 to port 22 in linux box2.

Finally when you connect to your first linux box use port 22 and use port 2222 for second linux box.


Regards






REgards

Last edited by fcintron; 01-26-2011 at 02:22 PM.
 
Old 01-27-2011, 03:37 AM   #3
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Original Poster
Rep: Reputation: 1
Question

Just looking for the reply button there lol found it.

Yes I do realise that now sincere apologies.

I have take for example 2 virtual IP addresses, well ifcfg-eth0:1 and ifcfg-eth0:2 right?

eth0:1 is on IP address 192.168.0.101 (I think going off my own memory)
eth0:2 is on IP address 192.168.0.102 (right)?

Ignore the dns's for what I said in my last post, use this one as this is more like my current setup:
ftp.example1.com resolves in my internal lan dns as 192.168.0.101
ftp.example2.com resolves in my internal lan dns as 192.168.0.102

This works fine when setting up 192.168.0.101 as the virtual host in proftp and same with 192.168.0.102.

So yes when I go to login from outside of my LAN, it doesnt, just bypasses them onto the users home directory.

What I am basically after overall is I have say:
'exampleuser'

They have a password:
'mypassword'

I want them to be able to maintain say 2 sites residing in:
/var/www/html/example1
&
/var/www/html/example2

When they login to ftp.example1.com it chroots them into: /var/www/html/example1
When they login to ftp.example2.com it chroots them into: /var/www/html/example2

When using either address for the ftp connection, but their user home directory is:
/home/exampleuser/

When the user tries say ftp.example1.com from a WAN connection, it doesnt log them into the directory they want to log into which would be '/var/www/html/example1'

It instead takes them to their home directory: '/home/exampleuser/'

Hope this makes better sense than what I put before.

Thats basically the output I would like to setup, but I cant seem to make sense of the proftp guidelines since their all in ipchains and not tables.

Just to make sense of this further, the firewall is set onto pfSense now, so I have an old Celeron processor computer with pfSense router software installed, but the ip address of the one that has my ftp server thats plugged into my router as a static mapped ip address from the dhcp server as 192.168.0.2.

Where as say my wan IP (not that I think that matters much to this config as its whats going through the router and what proftp see's is 80.20.223.223 (just as a random example, it isnt just illustrating my setup.

Thanks for your reply and I look forward to anymore,
Jez.

Last edited by j.smith1981; 01-27-2011 at 03:42 AM.
 
Old 01-31-2011, 08:48 PM   #4
fcintron
Member
 
Registered: Oct 2010
Location: México
Distribution: Centos
Posts: 72

Rep: Reputation: 4
I think problem is in your ftp configurzation.
What happens when you try to login to your ftp server inside your LAN, what home directory is used?

I just found this thread in Ubuntu´s forum, which talks about a configuration very similar to yours.
http://ubuntuforums.org/showthread.php?t=398150
They are using vsftpd for server. You should use vsftpd because is very very very secure.


Regards
 
  


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
[SOLVED] Masquerading with iptables debeb Linux - Networking 1 07-05-2010 01:19 PM
iptables ipchains Simple Guide.... ziox Linux - Security 8 09-07-2004 08:07 PM
masquerading and ipforwarding (ipchains) magguz Linux - Newbie 1 09-24-2003 01:25 PM
Iptables Masquerading GOLDF1NG3R Linux - Security 3 11-10-2001 11:51 PM
Iptables Masquerading GOLDF1NG3R Linux - Networking 4 11-01-2001 04:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:30 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