LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-10-2007, 01:55 PM   #1
Linux For Ever
Member
 
Registered: Jun 2006
Location: KSA
Distribution: Slackware 12.2
Posts: 49

Rep: Reputation: 15
FTP port in the server


Hi all.

I've old pc with slackware 12, and i want to make some security testing (iptables). i can use ssh and samba, but i can't use ftp and nfs.

i don't use tcp_wrappers.

here is my iptables rules:

#!/bin/bash
# Date: 3.Nov.2007

IPTABLES=/usr/sbin/iptables
LOCALNETWORK=192.168.1.0/24

$IPTABLES -F

$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD DROP

$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -p icmp -s $LOCALNETWORK -j ACCEPT
$IPTABLES -A INPUT -p tcp -s $LOCALNETWORK -m multiport --dport 21,22,139,445,2049 -j ACCEPT
$IPTABLES -A INPUT -p udp -s $LOCALNETWORK -m multiport --dport 21,22,137,138,2049 -j ACCEPT

if i flushed all rules and make the default policy is ACCEPT, i can use nfs and ftp.

can u help me?
 
Old 11-10-2007, 03:49 PM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
For ftp usage: modprobe ip_conntrack_ftp

For NFS usage: http://rlworkman.net/howtos/NFS_Firewall_HOWTO
 
Old 11-11-2007, 04:26 AM   #3
Linux For Ever
Member
 
Registered: Jun 2006
Location: KSA
Distribution: Slackware 12.2
Posts: 49

Original Poster
Rep: Reputation: 15
Thank you rworkman.

ftp works fine, but clients (without any firewall rules) can't connect to mount NFS file exported in this machine.

look at my firewall rules after opening another ports.

#!/bin/bash
# Date: 3.Nov.2007

## load ip_conntrack_ftp module
/sbin/modprobe ip_conntrack_ftp

IPTABLES=/usr/sbin/iptables
LOCALNETWORK=192.168.1.0/24

$IPTABLES -F

$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD DROP

$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -p icmp -s $LOCALNETWORK -j ACCEPT
## OpenSSH
$IPTABLES -A INPUT -p tcp -s $LOCALNETWORK --dport 22 -j ACCEPT
$IPTABLES -A INPUT -p udp -s $LOCALNETWORK --dport 22 -j ACCEPT
## FTP
$IPTABLES -A INPUT -p tcp -s $LOCALNETWORK --dport 21 -j ACCEPT
$IPTABLES -A INPUT -p udp -s $LOCALNETWORK --dport 21 -j ACCEPT
## SAMBA
$IPTABLES -A INPUT -p tcp -s $LOCALNETWORK -m multiport --dport 139,445 -j ACCEPT
$IPTABLES -A INPUT -p udp -s $LOCALNETWORK -m multiport --dport 137,138 -j ACCEPT
## NFS
$IPTABLES -A INPUT -p tcp -s $LOCALNETWORK -m multiport --dport 861,863,865,1110,2049,4045 -j ACCEPT
$IPTABLES -A INPUT -p udp -s $LOCALNETWORK -m multiport --dport 861,863,865,1110,2049,4045 -j ACCEPT

there is another question.
How can i know what's port i need to open it to make service work? e.g samba need 139,445 on tcp and 137,138 on udp.

/etc/service show me a lot of port for NFS,SAMBA and so on.

Thank you.
 
Old 11-11-2007, 11:27 PM   #4
Linux For Ever
Member
 
Registered: Jun 2006
Location: KSA
Distribution: Slackware 12.2
Posts: 49

Original Poster
Rep: Reputation: 15
any suggestion?
I'm waiting.....
 
Old 11-11-2007, 11:42 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
For NFS, you need to start the relevant services on both ends of the connection, and you'll need to refer to that other document I mentioned above; without more specific information on what you need, I don't know what other suggestions you might want.
Read the docs, try to implement what you need, and if you run into specific issues, then ask.
 
  


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
My router has a ftp server and won't forward the port greeklegend Linux - Server 6 09-10-2006 02:41 AM
CentOS Opening port for FTP Server Thin Linux - Distributions 3 11-16-2005 11:38 AM
SuSE 9.2 - FTP Port open with no FTP service?!?! don_wombat Linux - Security 12 12-01-2004 03:14 PM
Outside FTP Port 21 redirect to different port inside LAN??? hendrixx Linux - Security 5 06-05-2004 06:42 PM
Port forward ftp to windoz server (lan) dulaus Linux - Networking 6 06-11-2003 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:21 AM.

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