LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-23-2005, 02:37 PM   #1
crazykiller
Member
 
Registered: Sep 2005
Posts: 58

Rep: Reputation: 15
FTP & Forwarding


Ok first off...

Im trying to setup a FTP Server on my linux machine that im using as a HTTP server and a router.

Im using VSFTPD as the FTP server and i cant connect to it. A friend told me to try TELNET or something and that failed. (I think it was in console telnet 21)

Onto the forwarding. Im trying to forward any given port to 192.168.0.5:80 As im trying to run a webserver on linux and one on my Windows PC so i dont have to keep updating files on each and i can just type xxx.xxx.xxx.xxx:PORT and it will forward to my windows files that are up to date.

Ive tried masquerading etc and no use there.

Im really confused here
 
Old 11-23-2005, 05:39 PM   #2
number9
Member
 
Registered: Dec 2003
Location: Fresno
Distribution: Gentoo Ricer
Posts: 85

Rep: Reputation: 15
The description of your goal is unclear. It sounds like you are trying to make a web site and want to see it happening on IIS and Apache, is that correct? If this is the case, you can install Samba on the Linux box and make the share show up in the web server, with a symbolic link perhaps. Then map the share to a network drive letter on the Windows box and make that drive a Virtual Folder in IIS. You'll have one directory that both feed off of.
 
Old 11-24-2005, 10:01 AM   #3
crazykiller
Member
 
Registered: Sep 2005
Posts: 58

Original Poster
Rep: Reputation: 15
Problem 1)
What i have is 2 machines


Linux (acting as the internet server, firewall, router and a webserver)
Windows (my pc with XAMPP on it)

I want to be able to forward any port to my windows PC but i dont know how to.

Problem 2)
I have a VSFTPD installed on my linux machine and it doesnt allow me to connect. It doesnt say anything about passwords it just says unable to connect.
 
Old 11-24-2005, 08:00 PM   #4
wym
LQ Newbie
 
Registered: Oct 2005
Location: Toronto
Distribution: Red Hat 8.0
Posts: 26

Rep: Reputation: 15
for problem 2:
run netstat -an and see if tcp port 21 is LISTENING, if not, it means ftp is not started at all. if yes, try this:

telnet localhost 21
or,
ftp localhost

and login with a shell user name:

user crazerkiller
pass XXXX

this should bring you to the home directory

Last edited by wym; 11-24-2005 at 08:04 PM.
 
Old 11-25-2005, 10:11 AM   #5
crazykiller
Member
 
Registered: Sep 2005
Posts: 58

Original Poster
Rep: Reputation: 15
Using telnet 21 i get

"> telnet localhost 21
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host."

And ftp localhost

"> ftp localhost
Trying 127.0.0.1...
Name (localhost:root):
EOF received; login aborted."

Ive probaly done the ftp part wrong but hey new to linux CMD line
 
Old 11-25-2005, 12:41 PM   #6
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
For problem 2...

1. service vsftpd status
service vsftpd start
service vsftpd restart
( commands for ftp service status n restart)

2. vi /etc/vsftpd/vsftpd.conf --> configuration file for vsftpd

3. vi /etc/vsftpd.ftpusers --> comment the users which you want to log into ftp server

4. vi /etc/vsftpd.user_list --> comment the users which you want to log into ftp server

5. ftp <local-ip>
enter user-name & password.
( running ftp)

For problem 1...

For packet forwarding... You need to
echo 1 > /proc/sys/net/ipv4/ip_forward

This enables packet forwarding.. n after that you need to use IPTABLES for port forwarding.
For that google it appropriately.
 
Old 11-25-2005, 04:47 PM   #7
wym
LQ Newbie
 
Registered: Oct 2005
Location: Toronto
Distribution: Red Hat 8.0
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by crazykiller
Using telnet 21 i get

"> telnet localhost 21
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host."

And ftp localhost

"> ftp localhost
Trying 127.0.0.1...
Name (localhost:root):
EOF received; login aborted."

Ive probaly done the ftp part wrong but hey new to linux CMD line
for security reasons, ftpd does not let root to connect to it directly, please try another general user.
 
Old 11-26-2005, 03:34 AM   #8
crazykiller
Member
 
Registered: Sep 2005
Posts: 58

Original Poster
Rep: Reputation: 15
Ok that was the reason why lol i was connecting through root so it didnt allow it
 
Old 11-26-2005, 04:06 AM   #9
karunesh
Member
 
Registered: Jan 2002
Location: India
Distribution: CentOS/Mandriva
Posts: 126

Rep: Reputation: 15
Yes by default root is not allowed to make FTP connection..but you can change this (not suggestable). Just modify the file '/etc/vsftpd.ftpusers' and remove the entry by name of root.

About your first issue I think you are looking something like 1:1 NAT. So for that you can use 'iptables' with DNAT.
 
Old 11-26-2005, 09:12 AM   #10
crazykiller
Member
 
Registered: Sep 2005
Posts: 58

Original Poster
Rep: Reputation: 15
I dont know anything about DNAT NAT or Iptables :S
 
  


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
NAT forwarding FTP ports Ossar Linux - Networking 4 03-14-2005 12:07 PM
FTP port forwarding tomammon Linux - Networking 1 10-15-2004 06:49 AM
port forwarding using iptables (ftp) spank Linux - Newbie 3 01-20-2004 06:14 AM
Problem With FTP and Maybe Port forwarding ComFox Linux - Networking 1 09-19-2002 10:16 PM
ftp and ftp port forwarding with IPtables?? FunkFlex Linux - Security 3 04-24-2002 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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