如何借助linux vsftpd 配置在Linux上构建安全的FTP服务

1242人阅读
Linux(71)
作者同类文章X
在Centos6.3上搭建FTP服务器vsftpd
vsftpd是Linux平台下非常著名的一个ftp软件。vsftpd是 very secure ftp daemon 的缩写。
一、安装vsftpd
先检查系统中是否安装了vsftpd
[root@localhost Packages]# rpm -qa | grep vsftpd
[root@localhost Packages]#
如果没安装,就继续下面安装。
把 CentOS 的第一张安装光盘插入光驱,在光盘的Packages目录下找到vsftpd安装包,然后安装。
[root@localhost Packages]# ls *vsftpd*
vsftpd-2.2.2-11.el6.x86_64.rpm
[root@localhost Packages]# rpm -ivh vsftpd-2.2.2-11.el6.x86_64.rpm
Preparing...&&&&&&&&&&&&&&& ########################################### [100%]
&& 1:vsftpd&&&&&&&&&&&&&&&& ########################################### [100%]
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
二、启动vsftpd服务
[root@localhost Packages]# service vsftpd status
vsftpd is stopped
[root@localhost Packages]# service vsftpd start
Starting vsftpd for vsftpd:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
vsftpd的匿名用户的默认主目录是/var/ftp,vsftpd 的配置文件位于/etc/vsftpd目录下。
三、测试在客户端访问vsftpd服务器的/var/ftp目录。
在Windows系统的资源管理器的“地址”栏中输入“ftp://Centos系统的IP地址”,回车即显示当前/var/ftp目录下的内容啦。
四、vsftpd 匿名用户的上传和下载权限的配置
很多朋友配置vsftpd时不能使用匿名用户上传和下载(创建目录或删除、重命名文件夹),本文主要解决vsftpd的匿名用户权限配制问题。
配置要注意三部分,请一一仔细对照:
1. vsftpd.conf文件的配置(vi /etc/vsftpd/vsftpd.conf)
#允许匿名用户登录FTP(如果不允许匿名访问就设置为NO,后面有添加FTP用户的详细介绍)
anonymous_enable=YES
#打开匿名用户的上传权限
anon_upload_enable=YES
#打开匿名用户创建目录的权限
anon_mkdir_write_enable=YES
#允许匿名用户具有建立目录和上传之外的权限,如重命名、删除等。
anon_other_write_enable=YES
2. ftp目录的权限设置
ftp的根目录为/var/ftp,为了安全,这个目录默认不允许设置为777权限,否则ftp将无法访问。/var/ftp/pub是匿名用户的默认访问目录,即vsftpd.conf文件中没有anon_root设置时的默认目录。不知为何,如果用anon_root指定其它目录后,在终端用ftp命令匿名登录就失败,并提示:500 OOPS: vsftpd: refusing to run with writable anonymous root 错误,目前还没有找到具体原因和解决办法。
一般至此,便实现vsftpd匿名用户的上传下载了,如果还不行,就按下面说明配置一下selinux。
3. selinux的配置
SELinux(Security-Enhanced Linux) 是美国国家安全局(NAS)对于强制访问控制的实现,是 Linux上最杰出的新安全子系统。NSA是在Linux社区的帮助下开发了一种访问控制体系,在这种访问控制体系的限制下,进程只能访问那些在他的任务中所需要文件。SELinux 默认安装在 Fedora 和 Red Hat Enterprise Linux 上,也可以作为其他发行版上容易安装的包得到。
最简单的办法是关闭selinux
方法1:修改/etc/selinux/config文件中的SELINUX=&& 为 disabled ,然后重启。(验证通过)
方法2:用命令setenforce 0,无需重启。(setenforce的格式:setenforce [ Enforcing | Permissive | 1 | 0 ]) (转述的,没试过)
方法3:在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux。(转述的,没试过)
使用getenforce查看当前selinux是否正在运行。
如果不关闭selinux,就要设置selinux的ftp权限。(转述的,没试过)
(1)使用getsebool -a | grep ftp查看ftp相关设置状态,我们要将allow_ftpd_anon_write设为on。
(2)使用setsebool -P 进行设置。例:setsebool -P allow_ftpd_anon_write=on。
   或使用togglesebool进行bool值取反,例如togglesebool allow_ftpd_anon_write。
(3)修改selinux安全上下文,先介绍两个命令:
   命令1:ls -Z  ps -Z  id -Z  # 分别可以看到文件,进程和用户的SELinux属性
   命令2:#chcon 改变SELinux安全上下文
   chcon -u&& 对象
       -r
       -t
       -R 递归
       --reference 源文件 目标文件&&&&&&&&& # 复制安全上下文
   使用方法:
    步骤1:ls -Zd /var/ftp/upload/ 通常会看到:
     drwxr-xr-x ftp root system_u:object_r:public_content_t /var/ftp/upload/
    步骤2、chcon -R -t public_content_rw_t /var/ftp/upload/
    步骤3、ls -Zd /var/ftp/upload/ 如果看到如下信息就OK了:
     drwxr-xr-x ftp root system_u:object_r:public_content_rw_t /var/ftp/upload/
  最后还是重启下selinux和vsftpd吧,不重启其实也没关系。重新登录到ftp上,应该就能解决问题了。
  另,selinux的图形界面 可由system-config-selinux命令进入。
===============================================================================
下面转载一个关于FTP的好帖子,转自:
FTP服务器的简介就不介绍了,相信大家都知道是什么东东。不了解的就google吧!这里用到的FTP服务器软件是非常著名的vsftpd.
1.安装vsFTPd软件
源码安装就不说了,可以google,因为在线安装很方便的.
Fedora下安装很简单 yum install vsftpd 即可.
2.启动/重启/关闭vsftpd服务器
[root@localhost ftp]# /sbin/service vsftpd restart
Shutting down vsftpd:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
Starting vsftpd for vsftpd:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [& OK& ]
OK表示重启成功了.
启动和关闭分别把restart改为start/stop即可.
如果是源码安装的,到安装文件夹下找到start.sh和shutdown.sh文件,执行它们就可以了.
3.与vsftpd服务器有关的文件和文件夹
vsftpd服务器的配置文件的是: /etc/vsftpd/vsftpd.conf
vsftpd服务器的根目录,即FTP服务器的主目录:
[root@localhost ftp]# more /etc/passwd|grep ftp
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
这样你就能看到FTP的服务器的目录在/var/ftp处
如果你想修改服务器目录的路径,那么你只要修改/var/ftp到别处就行了
4.添加FTP用户
有的FTP服务器需要用户名和密码才能登录,就是因为设置了FTP用户和权限.
FTP用户一般是不能登录系统的,只能进入FTP服务器自己的目录中,这是为了安全.这样的用户就叫做虚拟用户了.实际上并不是真正的虚拟用户,只是不能登录SHELL了而已,没能力登录系统.
/usr/sbin/adduser -d /opt/test_ftp -g ftp -s /sbin/nologin test
这个命令的意思是:
使用命令(adduser)添加test用户,不能登录系统(-s /sbin/nologin),自己的文件夹在(-d /opt/test_ftp)),属于组ftp(-g ftp)
然后你需要为它设置密码:passwd test
这样就添加了一个FTP用户了.下面的示例可以帮助你进入FTP服务器了.
[root@localhost ftp]# ftp
ftp& open 192.168.0.33
Connected to 192.168.0.33 (192.168.0.33).
220 (vsFTPd 2.0.5)
Name (192.168.0.33:gxl): test
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
221 Goodbye.
在windows中,只要在浏览器中输入 ftp://192.168.0.33 进入FTP服务器,然后 右键 登录,输入用户名和密码就可以登录自己的目录了.
当然你要保证自己能读写自己的目录,就要在配置文件vsftpd.conf里设置一下就可以读写了.
local_enable=yes
write_enable=yes
local_umask=022
5.匿名上传下载
修改配置文件即可vsftpd.conf,确定有以下几行,没有自己添加进去就可以了.
anonymous_enable=yes
anon_upload_enable=yes
anon_mkdir_write_enable=yes
anon_umask=022
然后你可以新建一个文件夹,修改它的权限为完全开放,任何用户就可以登录这个文件夹,并上传下载文件:
mkdir /var/ftp/guest
chmod 777 /var/ftp/guest
6.定制进入FTP服务器的欢迎信息
在vsftpd.conf文件中设置:
dirmessage_enable=yes
然后进入用户目录建立一个.message文件,输入欢迎信息即可(我这里写入的是Welcome to gxlinux's FTP!):
[root@localhost test_ftp]# ftp 192.168.0.33
Connected to 192.168.0.33 (192.168.0.33).
220 (vsFTPd 2.0.5)
Name (192.168.0.33:gxl): test
331 Please specify the password.
230-Welcome to gxlinux's FTP!
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
7.实现虚拟路径
将某个目录挂载到FTP服务器下供用户使用,这就叫做虚拟路径.
比如将gxl用户的目录挂载到FTP服务器中,供FTP服务器的用户使用,使用如下命令即可:
[root@localhost opt]# mount --bind /home/gxl /var/ftp/pub #使用挂载命令
[root@localhost opt]# ls /var/ftp/pub
LumaQQ& Screenshot.png 桌面
8.打开vsFTPd的日志功能
添加下面一行到vsftpd.conf文件中,一般情况下该文件中有这一行,只要把前面的注释符号#去掉即可,没有的话就添加,或者修改:
xferlog_file=/var/log/vsftpd.log
9.限制链接数,以及每个IP最大的链接数
修改配置文件中,例如vsftp最大支持链接数100个,每个IP能支持5个链接:
max_client=100
10.限制传输速度
修改配置文件中,例如让匿名用户和vsftd上的用户(即虚拟用户)都以80KB=20的速度下载
anon_max_rate=81920
local_max_rate=81920
11.将用户(一般指虚拟用户)限制在自家目录
修改配置文件中,这样用户就只能访问自己家的目录了:
chroot_local_user=yes
如果只想某些用户仅能访问自己的目录,其它用户不做这个限制,那么就需要在chroot_list文件(此文件一般是在/etc/vsftpd/中)中添加此用户.
编辑此文件,比如将test用户添加到此文件中,那么将其写入即可.一般的话,一个用户占一行.
[root@localhost vsftpd]# cat chroot_list
12.绑定某个IP到vsFTPd
有时候要限制某些IP访问服务器,只允许某些IP访问,例如只允许192.168.0.33访问这个FTP,同样修改配置文件:
listen_address=192.168.0.33
=======================================================================
自己配置的 vsftpd.conf (主动模式和被动模式都支持(已验证),还可以输出日志文件)
[root@localhost vsftpd]# pwd
/etc/vsftpd
[root@localhost vsftpd]# cat vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
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
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
# 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_username=whoever
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
# 指定日志目录(还没研究这个日志和后面的日志有何区别,呵呵):
xferlog_file=/ftptest/xferlog
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
# 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
# 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
# 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
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
# 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_local_user=YES
#chroot_list_enable=YES
# (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
# 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
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
# other...
anon_other_write_enable=YES
#anon_root=/var/ftp/pub
dual_log_enable=YES
# 指定日志目录:
vsftpd_log_file=/ftptest/vsftpd.log&& &
# 开启主动模式: &
port_enable=YES
# 开启被动模式(默认开启被动模式,想关闭被动模式需要设置NO): &
pasv_enable=YES
# 指定被动模式端口范围: &
pasv_min_port=50000
pasv_max_port=60000
[root@localhost vsftpd]#
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:148683次
积分:2872
积分:2872
排名:第6737名
原创:136篇
转载:65篇
(2)(3)(3)(6)(5)(3)(1)(1)(2)(10)(5)(10)(33)(12)(2)(1)(1)(4)(4)(5)(9)(6)(5)(5)(5)(2)(10)(17)(4)(17)(9)linux下如何快速搭建安全的FTP服务器_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
linux下如何快速搭建安全的FTP服务器
上传于||文档简介
&&选​填​,​简​要​介​绍​文​档​的​主​要​内​容​,​方​便​文​档​被​更​多​人​浏​览​和​下​载​。
阅读已结束,如果下载本文需要使用
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩1页未读,继续阅读
你可能喜欢如何借助vsftpd在Linux上构建安全的FTP服务_百度知道
如何借助vsftpd在Linux上构建安全的FTP服务
提问者采纳
service tftp startchk畅虎扳臼殖铰帮歇爆忙config --list tftpchkconfig tftp on然后设置用户名和密码
其他类似问题
为您推荐:
vsftpd的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁linux下ftp服务器vsftpd服务的安装与配置
& linux下ftp服务器vsftpd服务的安装与配置
linux下ftp服务器vsftpd服务的安装与配置
ftp是相当古老的传输协议之一,它的主要功能是在服务器与客户端之间进行文件传输。是下的一款小巧轻快,安全易用的FTP服务器软件,是一款在各个发行版中最受推崇的FTP服务器软件。下面以rhel5.0 linux下介绍的安装、配置。
实验坏境:
操作系统:Red Hat Enterprise Linux AS 5.0
内核版本:2.6.18-8.el5
CPU构架:i386 SMP
附件软件:Red Hat Enterprise Linux AS 5.0 DVD ISO文件
在rhel linux下安装服务
1. 通过yum方式安装:
# groupinstall "FTP Server"
注:如果您的linux操作系统没有rhn上注册,并且未配置yum,请看此文:
2. 通过rpm命令安装
# mkdir -p /mnt/iso
# mount -o loop /opt/rhel5.0.iso /mnt/iso
# rpm -ivh /mnt/iso/Server/d-2.0.5-10.el5.i386.rpm
3. 通过源码编译的方式安装d
tar -zxvf vsftpd-2.0.5-10.tar.gz
cd vsftpd-2.0.5-10
make && make install
vsftpd 相关文件和目录介绍
1. /etc/vsftpd/vsftpd.conf
linux vsftpd最主要的配置文件
2. /etc/vsftpd/ftpusers
此文件用来设置不允许访问ftp服务的用户,一行一个用户名。
3. /etc/vsftpd/user_list
vsftpd自带的访问阻止功能,此文件能否生效由vsftpd.conf的userlist_enable,userlist_deny两个参数决定。
4. /etc/pam.d/vsftpd
这个是vsftpd使用pam模块的相关设置文件,主要用来认证身份和阻止特定用户。
5. /usr/sbin/vsftpd
vsftpd的主要执行文件。
6. /etc/rc.d/init.d/vsftpd
vsftpd服务管理文件。
7. /var/ftp
vsftpd的默认匿名用户登录的根目录。
1234567891011121314
1. /etc/vsftpd/vsftpd.conflinux vsftpd最主要的配置文件2. /etc/vsftpd/ftpusers此文件用来设置不允许访问ftp服务的用户,一行一个用户名。3. /etc/vsftpd/user_listvsftpd自带的访问阻止功能,此文件能否生效由vsftpd.conf的userlist_enable,userlist_deny两个参数决定。4. /etc/pam.d/vsftpd这个是vsftpd使用pam模块的相关设置文件,主要用来认证身份和阻止特定用户。5. /usr/sbin/vsftpdvsftpd的主要执行文件。6. /etc/rc.d/init.d/vsftpdvsftpd服务管理文件。7. /var/ftpvsftpd的默认匿名用户登录的根目录。
Linux vsftpd配置参数介绍:
linux vsftpd的配置参数很多,我们可以通过man 5 vsftpd.conf命令获取到vsftpd.conf配置文件的详细帮助信息。下面介绍一些vsftpd常用的参数。
1. 与服务器相关的设置参数
connect_from_port_20=YES|NO
是否使用20号端口做为ftp-data的端口号
listen_port=21
设置ftp命令通道的端口号
dirmessange_enable=YES|NO
message_file=.message
上面两个参数用来配置用户进入到目录时显示某个文件中的内容。
listen=YES|NO
设置vsftpd是否stand alone方式启动。
pasv_enable=YES|NO
是否开启被动模式。
write_enable=YES|NO
用来设置是否允许用户上传文件。
idle_session_timeout=300
如果用户300秒内没有命令操作,则强制离线。
max_Clients=0
当vsftpd以stand alone运行时,用来设置最大同时在线数。
max_per_ip=0 用于设置同一IP允许的同时最大连接数。
pasv_max_port=0
pasv_min_port=0
用来设置被动模式(passive mode)使用的端口范围,为0时不受限制。
ftpd_banner="欢迎语句"
banner_file=/path/file
设置当用户连接到vsftpd服务器时显示的欢迎信息。
123456789101112131415161718192021222324
connect_from_port_20=YES|NO是否使用20号端口做为ftp-data的端口号listen_port=21设置ftp命令通道的端口号dirmessange_enable=YES|NOmessage_file=.message上面两个参数用来配置用户进入到目录时显示某个文件中的内容。listen=YES|NO设置vsftpd是否stand alone方式启动。pasv_enable=YES|NO是否开启被动模式。write_enable=YES|NO用来设置是否允许用户上传文件。idle_session_timeout=300如果用户300秒内没有命令操作,则强制离线。max_Clients=0当vsftpd以stand alone运行时,用来设置最大同时在线数。max_per_ip=0 用于设置同一IP允许的同时最大连接数。pasv_max_port=0pasv_min_port=0用来设置被动模式(passive mode)使用的端口范围,为0时不受限制。ftpd_banner="欢迎语句"banner_file=/path/file设置当用户连接到vsftpd服务器时显示的欢迎信息。
2. 与用户相关的参数
guest_username=ftp
指定来宾用户身份的用户名
guest_enable=YES|NO
是否将非匿名用户映射成来宾用户。
local_enable=YES|NO
是否允许/etc/passwd中的用户以实体用户的身份登录到ftp服务器。
local_max_rate=0 设置实体用户的传输速度,单位为bytes/s。
chroot_local_user=YES|NO
chroot_list_enable=YES|NO
chroot_list_file=/etc/vsftpd/chroot_list
用来设置哪些用户被限制在自己的目录内无法离开。
userlist_enable=YES|NO
userlist_deny=YES|NO
userlist_file=/etc/vsftpd/user_list
用来阻止相关用户登录到vsftpd服务器。
3. 匿名用户相关的参数
anonymous_enable=YES|NO
是否允许anonymouns用户登录到vsftpd服务器,下面的设置仅在此参数为YES时才有效。
anon_world_readable_only=YES|NO
仅仅允许下载可读的文件。
anon_mkdir_write_enable=YES|NO
anon_upload_enable=YES|NO
anon_other_write_enable=YES|NO
用于设置相关可写权限。
no_anon_password=YES|NO
anonymous登录时是否可以省略密码。
anon_max_rate=0
设置anonymous的最大传输速度。
anon_umask=077
anonymous用户上传文件的权限掩码。
1234567891011121314151617181920212223242526272829
guest_username=ftp指定来宾用户身份的用户名guest_enable=YES|NO是否将非匿名用户映射成来宾用户。local_enable=YES|NO是否允许/etc/passwd中的用户以实体用户的身份登录到ftp服务器。local_max_rate=0 设置实体用户的传输速度,单位为bytes/s。chroot_local_user=YES|NOchroot_list_enable=YES|NOchroot_list_file=/etc/vsftpd/chroot_list用来设置哪些用户被限制在自己的目录内无法离开。userlist_enable=YES|NOuserlist_deny=YES|NOuserlist_file=/etc/vsftpd/user_list用来阻止相关用户登录到vsftpd服务器。&&3. 匿名用户相关的参数anonymous_enable=YES|NO是否允许anonymouns用户登录到vsftpd服务器,下面的设置仅在此参数为YES时才有效。anon_world_readable_only=YES|NO仅仅允许下载可读的文件。anon_mkdir_write_enable=YES|NOanon_upload_enable=YES|NOanon_other_write_enable=YES|NO用于设置相关可写权限。no_anon_password=YES|NOanonymous登录时是否可以省略密码。anon_max_rate=0设置anonymous的最大传输速度。anon_umask=077anonymous用户上传文件的权限掩码。
4. 与安全相关的参数:
ascii_download_enable=YES|NO
ascii_upload_enable=YES|NO
是否允许ascii方式传输。
xferlog_enable=YES|NO
xferlog_file=/var/log/vsftpd.log
是否记录用户下载上传的文件。
ascii_download_enable=YES|NOascii_upload_enable=YES|NO是否允许ascii方式传输。xferlog_enable=YES|NOxferlog_file=/var/log/vsftpd.log是否记录用户下载上传的文件。
Linux下vsftpd服务的启动
1. 使用stand alone模式启动:
# /etc/rc.d/init.d/vsftpd start
# service vsftpd start
2. 使用super daemon来启动:
①. 将/etc/vsftpd/vsftpd.conf中的"listen=YES"改成"listen=NO"
②. # vi /etc/xinetd.d/vsftpd
service ftp
socket_type=stream
server=/usr/sbin/vsftpd
log_on_success+=DURATION USERID
log_on_failure+=USERID
disable=no
#注意大小写
③. # service vsftpd stop
# service xinetd restart
常见问题:
1. 问:我在客户端成功的登录到ftp服务器上后,为什么使用dir命令没有任何反应?
答:您可能位于局域网内,请尝试使用被动模式。
2. 问:为什么我的root用户不能登陆到我的vsftpd ftp服务器?
答:linux默认情况下不允许root登陆到ftp服务器的,在ftpuser,user_list去掉root用户就可以登录了。

我要回帖

更多关于 linux 查看vsftpd用户 的文章

 

随机推荐