Press "Enter" to skip to content

FreeBSD8.2下vsftp安装配置

由于涉及FTP到解决方案,特别在FreeBSD8.2下采用ports部署vsftp,配置如下:

先创建用户:leaf 密码:123456  采用adduser命令添加此用户,关于添加用户另一章中已经有介绍。

kiccleaf# cd /usr/ports/ftp/vsftpd
kiccleaf# make install clean

可以不用选择
Options for vsftpd 2.3.4 x

===> Compressing manual pages for vsftpd-2.3.4
===> Registering installation for vsftpd-2.3.4
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/vsftpd

If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.

For more information, and contact details about the security
status of this software, see the following webpage:
http://vsftpd.beasts.org/
kiccleaf#

防止修改错误先备份vsftpd.conf文件

kiccleaf# mv /usr/local/etc/vsftpd.conf /usr/local/etc/vsftpd.conf.bak
kiccleaf# ee/usr/local/etc/vsftpd.conf

在新建文件vsftpd.conf输入以下代码内容:

anonymous_enable=NO
write_enable=YES
local_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
data_connection_timeout=3
nopriv_user=nobody
listen=YES
secure_chroot_dir=/usr/local/share/vsftpd/empty
chroot_local_user=YES
tcp_wrappers=Yes
userlist_enable=Yes
userlist_deny=No
pasv_enable=Yes
pasv_min_port=65000
pasv_max_port=65100
userlist_file=/usr/local/etc/vsftpd.user_list

创建一个文件,添加可登陆的FTP用户

kiccleaf# echo leaf >> /usr/local/etc/vsftpd.user_list
kiccleaf# cd /usr/local/etc/
kiccleaf# ll
total 32
-rw-r--r--  1 root  wheel  3770 Jul 12 17:39 axelrc
drwxr-xr-x  2 root  wheel   512 Jul 12 17:12 devd
drwxr-xr-x  2 root  wheel   512 Jul 12 17:12 man.d
drwxr-xr-x  2 root  wheel   512 Jul 12 17:12 pam.d
drwxr-xr-x  2 root  wheel   512 Jul 12 18:39 rc.d
-r--r--r--  1 root  wheel  5010 Jul 12 21:22 vsftpd.conf
-r--r--r--  1 root  wheel  4586 Jul 12 21:20 vsftpd.conf.dist
-rw-r--r--  1 root  wheel     1 Jul 12 21:23 vsftpd.user_list
-r--r--r--  1 root  wheel  4499 Jul 12 17:37 wgetrc.sample
kiccleaf# cat /usr/local/etc/vsftpd.user_list
leaf  #刚执行添加的用户leaf
kiccleaf# /usr/local/libexec/vsftpd &
[1] 1952

添加到随系统启动项中

kiccleaf# echo vsftp_ebable=YES >>/etc/rc.conf

回去Win下采用FlashFxp进行链接测试


链接成功后

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注