Using the ftphosts File to Allow or Deny FTP Server Connection

You can create a file in /etc called ftphosts to allow or deny specific users or addresses from connecting to the FTP server. The format of the file is the word allow or deny, optionally followed by a username, followed by an IP or a DNS address:

allow username addressdeny username address

Listing 24.2 shows a sample configuration of this file.

Listing 24.2. ftphosts Configuration File for Allowing or Denying Users

# Example host access file## Everything after a '#' is treated as comment,# empty lines are ignoredallow fatima 208.164.186.1 208.164.186.2 208.164.186.4deny richard 208.164.186.5allow jane ubuntuforums.orgdeny john naughtysite.net allow ahmed 192.168.101.*allow ahmed ...

Get Ubuntu Unleashed 2013 Edition: Covering 12.10 and 13.04, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.