FTP服务的工作原理?
CS模式
FTP服务的工作模式有几种?是什么?
主动模式
被动模式
vsftpd的用户类型有几种?是什么?
有三种用户类型
1、匿名用户
2、本地用户
3、虚拟用户
vsftpd的基本配置 ( /etc/vsftpd/vsftpd.conf )
不允许匿名访问
# Allow anonymous FTP? (Beware - allowed by default if you comment this out). #anonymous_enable=YES anonymous_enable=NO
本地用户可以访问
# Uncomment this to allow local users to log in. local_enable=YES
可以进行写操作
# Uncomment this to enable any form of FTP write command. write_enable=YES
上传后文件的权限掩码
# Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) local_umask=022
禁止匿名用户上传
# Uncomment this to allow the anonymous FTP user to upload files. This only # has an effect if the above global write enable is activated. Also, you will # obviously need to create a directory writable by the FTP user. #anon_upload_enable=YES anon_upload_enable=NO
禁止匿名用户建立目录。
# Uncomment this if you want the anonymous FTP user to be able to create # new directories. #anon_mkdir_write_enable=YES anon_mkdir_write_enable=NO
开启目录标语功能
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
开启日志记录功能。
# Activate logging of uploads/downloads.
xferlog_enable=YES
使用20端口进行数据连接
# Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES
禁止上传文件更改宿主
# If you want, you can arrange for uploaded anonymous files to be owned by # a different user. Note! Using "root" for uploaded files is not # recommended! #chown_uploads=YES chown_uploads=NO
Vsftpd的服务日志保存路径
#chown_username=whoever # # You may override where the log file goes if you like. The default is shown # below. xferlog_file=/var/log/vsftpd.log #默认文件不存在,手动创建,入托更改vsftpd服务宿主用户是vsftpd,给用户对应写权限。
日志使用标准的记录格式
# If you want, you can have your log file in standard ftpd xferlog format xferlog_std_format=YES
空闲连接超时时间
# You may change the default value for timing out an idle session. #idle_session_timeout=600 #600是默认值
单次最大连续传输时间
# You may change the default value for timing out a data connection. #data_connection_timeout=120 #默认值120
支撑Vsftpd服务的宿主用户为手动建立的Vsftpd用户
# It is recommended that you define on your system a unique user which the # ftp server can use as a totally isolated and unprivileged user. #nopriv_user=ftpsecure nopriv_user=vsftpd #由此更改注意权限问题
支持异步传输功能。
# Enable this and the server will recognise asynchronous ABOR requests. Not # recommended for security (the code is non-trivial). Not enabling it, # however, may confuse older FTP clients. async_abor_enable=YES
支持ASCII模式的上传和下载功能。
# By default the server will pretend to allow ASCII mode but in fact ignore # the request. Turn on the below options to have the server actually do ASCII # mangling on files when in ASCII mode. # Beware that on some FTP servers, ASCII support allows a denial of service # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd # predicted this attack and has always been safe, reporting the size of the # raw file. # ASCII mangling is a horrible feature of the protocol. ascii_upload_enable=YES ascii_download_enable=YES
Vsftpd的登陆标语。
# You may fully customise the login banner string: ftpd_banner=This Vsftp server supports virtual users
禁止用户登出自己的FTP主目录
# You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. #deny_email_enable=YES # (default follows) #banned_email_file=/etc/vsftpd/banned_emails # # You may specify an explicit list of local users to chroot() to their home # directory. If chroot_local_user is YES, then this list becomes a list of # users to NOT chroot(). #chroot_list_enable=YES chroot_list_enable=NO
禁止用户登陆FTP后使用"ls -R"的命令。
# (default follows) #chroot_list_file=/etc/vsftpd/chroot_list # # You may activate the "-R" option to the builtin ls. This is disabled by # default to avoid remote users being able to cause excessive I/O on large # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume # the presence of the "-R" option, so there is a strong case for enabling it. #ls_recurse_enable=YES ls_recurse_enable=NO #此命令会对服务器性能造成很大的开销。
设定该Vsftpd服务工作在StandAlone模式
# When "listen" directive is enabled, vsftpd runs in standalone mode and # listens on IPv4 sockets. This directive cannot be used in conjunction # with the listen_ipv6 directive. listen=YES #此模式就是该服务拥有自己的守护进程支持,在ps -A命令下我们将可用看到vsftpd的守护进程名
设定支持TCP Wrappers
tcp_wrappers=YES ##可以实现主机访问控制
userlist_file中的用户将不得使用FTP
userlist_enable=YES

浙公网安备 33010602011771号