Solved

How to limit ftp access by ip address using iptables

Posted on 2011-03-03
8
515 Views
Last Modified: 2012-05-11
I would like to use iptables to limit access to ftp by ip address. What is the proper iptables syntax for that.
0
Comment
Question by:richmarotta1
  • 4
  • 4
8 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 35029814
You can use iptables or you can use tcp wrappers.

for iptables
iptables -A INPUT -p tcp -s <SOURCE_IP_ADDR/MASK>  --dport ftp  -j ACCEPT

iptables -A INPUT -p tcp -s <SOURCE_IP_ADDR/MASK>  --dport ftp  -j DROP

edit the file /etc/hosts.allow and enter
ftpd : localhost : allow
ftpd: 192.168.0.254 : deny
0
 

Author Comment

by:richmarotta1
ID: 35031076
I only changed the ip tables portion

iptables -A INPUT -p tcp -s <SOURCE_IP_ADDR/MASK>  --dport ftp  -j ACCEPT


This worked for my ftp client but is not working for Dreamweavers ftp transer method on the same development laptop. Any ideas why dreamweaver won't connect?
 
0
 

Author Comment

by:richmarotta1
ID: 35031088
What does this do and why would this be necessary?

I got ftp to work without it.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35031139
You don't have to do it normally, only when you are blocking a lot of addresses/ ports etc.

On your FTP, the dreamweaver user may not be enabled.  I don't know how you are exactly doing it.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:richmarotta1
ID: 35031162
I can connect to many other servers using dreamweaver so I don't think it'd the dreamweaver user on my laptop. The dreamweaver ftp client has the same server, user and pword as the ftp client.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35031198
ok.

I don't know your architecture.  What is not working?  Are you trying to ftp to the ftp server from dreamweaver ftp client.  Is the user id that dream weaver using is accessed without a trouble without using dreamweaver?
0
 

Author Comment

by:richmarotta1
ID: 35031206
yes and yes
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35031217
Check the port number that Dream Weaver trying to ftp to.  It should be 21.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MySql Database Installation 5 76
Squid Authentication 7 35
AWS CLI issues with Tags 3 31
nagios 1 12
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now