Question: How can I hide dotfiles (e.g. ".msg")
from the MLSD
command?
Answer: There are two possible ways of dealing
with FTP clients which use the MLSD
command for listing
directories, as opposed to the LIST
/NLST
commands.
Since the MLSD
command does not have the concept of "options",
unlike LIST
/NLST
, the ListOptions
directive does not apply to MLSD
as some would expect. Thus
using a configuration like so:
ListOptions +a
to hide dotfiles from LIST
commands does not work for
MLSD
. How, then, to hide dotfiles from MLSD commands? You can
configure proftpd so that it does not advertise the fact that it can support
the MLSD
command, via:
<IfModule mod_facts.c>
FactsAdvertise off
</IfModule>
Alternatively, you can use the HideFiles
and
IgnoreHidden
directives:
<Directory />
# Hide files whose names start with "."
HideFiles ^\.
<Limit LIST MLSD NLST>
# Do not include hidden files for LIST, MLSD, and NLST
IgnoreHidden on
</Limit>
</Directory>
This latter configuration will apply to LIST
, NLST
,
and MLSD
equally.
Question: How can I disable the mod_facts
module entirely? Some clients (e.g. ncftp) do not appear to implement
MLSD
properly, and do not honor the FEAT
response from
proftpd
when FactsAdvertise
is configured
off.
Answer: There is no easy way of disabling the
mod_facts
module at present; the
FactsAdvertise
directive is intended
to do this in a way compliant with the RFCs.
That said, you can compile proftpd
such that
mod_facts
is built as a DSO/shared module:
$ ./configure --enable-dso --with-shared=mod_facts ...
and then, in your proftpd.conf
, you simply omit any
"LoadModule mod_facts.c" directive, so that that module is never dynamically
loaded.
The mod_facts
module is distributed with ProFTPD, and is
normally compiled as a static module by default. However, if you wish to
have mod_facts
be built as a shared module, you would use:
$ ./configure --enable-dso --with-shared=mod_facts ...
Then follow the usual steps:
$ make
$ make install
© Copyright 2007-2020 The ProFTPD Project
All Rights Reserved