Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

maintenance cycle. Another default is that remote clients will be logged out
after five minutes of idle activity or a stalled data transfer. You can set idle
and stalled connection timeouts by uncommenting
idle_session_timeout and setting the time in seconds before idle
sessions are disconnected.


Other settings that might be important for managing your system’s resources
(networking bandwidth or memory) when offering FTP access include the
following:


dirlist_enable—Toggles  directory   listings    on  or  off.
dirmessage_enable—Toggles display of a message when the user
enters a directory. A related setting is ls_recurse_enable, which
you can use to disallow recursive directory listings.
download_enable—Toggles downloading on or off.
max_clients—Sets a limit on the maximum number of connections.
max_per_ip—Sets a limit on the number of connections from the same
IP address.

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:


Click here to view code image
allow username address
deny username address


Listing 34.2 shows a sample configuration of this file.


LISTING 34.2 ftphosts Configuration File for Allowing or Denying Users


Click here to view code image


#   Example host    access  file
#
# Everything after a '#' is treated as comment,
# empty lines are ignored
allow fatima 208.164.186.1 208.164.186.2 208.164.186.4
deny richard 208.164.186.5
Free download pdf