This example shows how you might set up a (possibly large) internet facing
FTP site
The emphasis will be on security and performance
We will see how by integrating vsftpd with xinetd
combination
Step
An example xinetd configuration file
To install it:
cp vsftpd
Let
disable = no
socket_type = stream
wait = no
This says that the service is active
user = root
server = /usr/local/sbin/vsftpd
The server program /usr/local/sbin/vsftpd is used to handle incoming FTP
requests
drop as much privilege as possible)
binary installed in /usr/local/sbin (or change the file path in the xinetd
file)
per_source =
instances =
For security
The total maximum concurrent connections is
no_access =
As an example of how to ban certain sites from connecting
be denied access
banner_fail = /etc/vsftpd
This is the file to display to users if the connection is refused for whatever
reason (too many users
Example of how to populate it:
echo
log_on_success += PID HOST DURATION
log_on_failure += HOST
This will log the IP address of all connection attempts
along with the time
process ID and usage duration will be logged too
like me
Step
An example file is supplied
cp nf /etc
Let
# Access rights
anonymous_enable=YES
local_enable=NO
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
This makes sure the FTP server is in anonymous
and upload permissions are disabled
the same as the default values anyway
is good to be clear
# Security
anon_world_readable_only=YES
connect_from_port_
hide_ids=YES
pasv_min_port=
pasv_max_port=
These settings
server cannot try and fake file content
This is also a performance boost
firewall setup!
# Features
xferlog_enable=YES
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
In order
wanting to be copied via the
attack (ASCII downloads are CPU heavy)
# Performance
one_process_model=YES
idle_session_timeout=
data_connection_timeout=
accept_timeout=
connect_timeout=
anon_max_rate=
In order
security
Linux kernel
Step
(on RedHat)
/etc/rc
If you run into problems
nf
# Access rights
anonymous_enable=YES
local_enable=NO
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
# Security
anon_world_readable_only=YES
connect_from_port_
hide_ids=YES
pasv_min_port=
pasv_max_port=
# Features
xferlog_enable=YES
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
# Performance
one_process_model=YES
idle_session_timeout=
data_connection_timeout=
accept_timeout=
connect_timeout=
anon_max_rate=
vsftpd
# vsftpd is the secure FTP server
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
per_source =
instances =
no_access =
banner_fail = /etc/vsftpd
log_on_success += PID HOST DURATION
log_on_failure += HOST
}
From:http://tw.wingwit.com/Article/program/Oracle/201311/18877.html