LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2010, 11:02 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Rep: Reputation: 48
Add allowed IP address to FTP server


I have a RHEL FTP server, which i'm told is setup to only allow certain IPs to connect to the FTP site. I have two questions though.

1) what file would show me what IPs are currently allowed?
2) what command do I do to add another IP to it?
 
Old 01-13-2010, 11:08 AM   #2
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 394

Rep: Reputation: 61
/etc/hosts.allow and /etc/hosts.deny?
 
Old 01-13-2010, 11:09 AM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
those files are empty. could it be somewhere else? like beneath sysconfig or something?
 
Old 01-13-2010, 11:39 AM   #4
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 394

Rep: Reputation: 61
Depends where the restriction happens - at the FTP server level, in which case we'd need to know which FTP server daemon you're running or at the firewall level. Iptables perhaps? Under /etc/sysconfig/iptables
 
Old 01-13-2010, 11:45 AM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
vsftpd is the ftp server i'm running. looks like iptables has some accepts statements in there. maybe that's where I add them? or could there be something in the vsftpd config also?
 
Old 01-13-2010, 01:42 PM   #6
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Lubuntu 14.04 LTS, Kali
Posts: 297

Rep: Reputation: 30
The best bet would be to edit your /etc/host.allow and /etc/hosts.deny files to control access. A prerequisite is to make sure tcp wrappers in enabled in your /etc/vsftpd.conf file :

Code:
# TCP Wrappers
tcp_wrappers=YES
Deny all incoming connections by default in /etc/hosts.deny by adding:
Code:
vsftpd: ALL
Specify the allowed connection in /etc/hosts.allow by adding:

Code:
vsftpd: 192.168.0.,209.223.0.124
The above example only allows ftp access from the local network ( 192.168.0.* ) and the IP 209.223.0.124

If there are no /etc/hosts.allow|deny files then you can just create them but make sure that they are rw only by root.

Last edited by uncle-c; 01-13-2010 at 01:49 PM.
 
Old 01-13-2010, 01:48 PM   #7
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
I'm just helping maintain the server, i'm not at liberty to reconfigure it like you're suggesting. I do see lines in my iptables like this, so I think I just need to add a new one, but how?

-A INPUT -s 1.2.3.4 -d 5.6.7.8 -j ACCEPT
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to add Proxy IP address in DHCP Server cheesewizz Linux - Networking 1 07-23-2009 07:44 AM
Sending WAN IP address to FTP server sloik2000 Linux - Networking 2 02-08-2005 03:59 PM
trusted ip address access to ftp server i_am_so_kittle Linux - Security 3 05-08-2004 11:41 AM
ftp server not finding my ip address fideli Linux - Software 7 02-18-2004 12:47 PM
FTP Server IP address problem johnk Linux - Networking 2 08-21-2003 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration