求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#1

帖子 micro_cy » 2014-09-26 17:52

[color=#400000]/etc/vsftpd.conf[/color]

listen=YES
max_clients=200
max_per_ip=10
anonymous_enable=NO

local_enable=YES

write_enable=NO

local_umask=722

anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES

use_localtime=YES

connect_from_port_20=YES

chown_uploads=YES

xferlog_file=/var/log/vsftpd.log

xferlog_std_format=YES
log_ftp_protocol=YES

idle_session_timeout=600

data_connection_timeout=120

nopriv_user=vsftpd

async_abor_enable=YES

dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
ascii_upload_enable=YES
ascii_download_enable=YES

ftpd_banner=Welcome to CY blah FTP service.Welcome to CY blah FTP service.Welcome to CY blah FTP service.

chroot_local_user=YES
chroot_list_enable=no
local_root=/home/ftp

chroot_list_file=/etc/vsftpd.chroot_list

ls_recurse_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty

pam_service_name=vsftpd
pam_service_name=/etc/pam.d/vsftpd
userlist_enable=no
userlist_deny=no
tcp_wrappers=YES
pasv_promiscuous=YES

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
guest_enable=no
guest_username=overlord
virtual_use_local_privs=no
user_config_dir=/etc/vsftpd/vconf

[color=#800000]/etc/pam.d/vsftpd
[/color]
#%PAM-1.0
auth sufficient /lib/x86_64-linux-gnu/security/pam_userdb.so db=/etc/vsftpd/virtusers
account sufficient /lib/x86_64-linux-gnu/security/pam_userdb.so db=/etc/vsftpd/virtusers
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
#auth required pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
session required pam_loginuid.so
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#3

帖子 micro_cy » 2014-09-29 20:58

终于调试成功了
以下是我的配置文件修改的情况:
# Example config file /etc/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.
#
#
# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# Useful to not write over hidden files:
force_dot_files=YES
# Hide the info about the owner (user and group) of the files.
hide_ids=YES
# Connection limit for each IP:
max_per_ip=20
# Maximum number of clients:
max_clients=200
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
# instead of an IPv4 one. This parameter and the listen parameter are mutually
# exclusive.
#listen_ipv6=YES
#
# Allow anonymous FTP? (Disabled by default)
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=722
#
# 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
anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# If enabled, vsftpd will display directory listings with the time
# in your local time zone. The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES
#
# Activate logging of uploads/downloads.
# 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
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
log_ftp_protocol=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
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
#
# 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.
dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to CY blah FTP service.Welcome to CY blah FTP service.Welcome to CY 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 restrict local users to their home directories. See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# 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().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
chroot_list_enable=YES
#
ssl_enable=NO
allow_anon_ssl=YES
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=YES
ssl_sslv3=YES
# Filezilla uses port 21 if you don't set any port
# in Servertype "FTPES - FTP over explicit TLS/SSL"
# Port 990 is the default used for FTPS protocol.
# Uncomment it if you want/have to use port 990.
# listen_port=99
#
#
local_root=/etc/vsftpd/vconf/$USER
# (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=YES
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty. Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd.virtual
pam_service_name=/etc/pam.d/vsftpd
#
userlist_enable=YES
userlist_deny=no
userlist_file=/etc/vsftpd.allowed_users
tcp_wrappers=YES
#
pasv_promiscuous=YES
pasv_min_port=12000
pasv_max_port=12100
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
guest_enable=YES
guest_username=overlord
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/vconf
user_sub_token=$USER
hide_ids=YES
#
#%PAM-1.0
auth sufficient /lib/x86_64-linux-gnu/security/pam_userdb.so db=/etc/vsftpd/virtusers
account sufficient /lib/x86_64-linux-gnu/security/pam_userdb.so db=/etc/vsftpd/virtusers
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
session required pam_loginuid.so



该建立的目录需要建立,该给的权限要给,与1楼的区别可以对比一下,原来的配置文件que shao的文件需要自己手动建立,如果有什么问题的话请回帖交流~
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#4

帖子 micro_cy » 2014-09-29 21:02

不能锁定虚拟用户在自己的目录里面,可以访问所有/下的文件,就和管理员一个权限了,无敌了
上次由 micro_cy 在 2014-10-13 16:13,总共编辑 1 次。
digimoon
帖子: 8
注册时间: 2009-06-26 14:49

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#5

帖子 digimoon » 2014-10-09 21:46

求助,我已有一个用户digi想在用户目录下建一个地方让别人传东西过来,但是配置弄了很久都搞不定登陆失败能帮忙看看么

#cat /etc/vsftpd.conf

代码: 全选

listen=YES
anonymous_enable=NO
local_enable=YES
virtual_use_local_privs=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES

allow_writeable_chroot=YES
chroot_local_user=YES
chroot_list_enable=NO

secure_chroot_dir=/var/run/vsftpd/empty

pam_service_name=vsftpd.virtual

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

guest_enable=YES
guest_username=digi

user_config_dir=/etc/vsftpd/vconf
#cat /etc/vsftpd/vconf/test

代码: 全选

local_root=/home/digi/test
#cat /etc/pam.d/vsftpd.virtual

代码: 全选

#%PAM-1.0
auth       required     pam_userdb.so db=/etc/vsftpd/vuser
account    required     pam_userdb.so db=/etc/vsftpd/vuser
session    required     pam_loginuid.so
#cat /etc/vsftpd/vuser

代码: 全选

test
123
#db6.0_load -T -t hash -f /etc/vsftpd/vuser /etc/vsftpd/vuser.db
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#6

帖子 poloshiao » 2014-10-10 6:34

我已有一个用户digi想在用户目录下建一个地方让别人传东西过来
1. 別人 使用什麼 client 端程式 上傳文件檔案 ?
從 client 端程式 失敗記錄 log file 來查 比較精準

2. 從 vsftpd server 查看 /var/log/vsftpd.log 文件檔案
可以檢查 登入記錄

3. 如果希望有更詳細的記錄 幫你抓錯
參閱
http://manpages.ubuntu.com/manpages/tru ... onf.5.html
這些參數的設定值
dual_log_enable
log_ftp_protocol
syslog_enable
xferlog_enable
vsftpd_log_file
xferlog_file
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#7

帖子 micro_cy » 2014-10-11 16:20

chroot_local_user=YES
chroot_list_enable=NO


这句,要么同为YES,需要编辑chootlist文件,要么就同为NO,具体原因,自己百度一下。
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#8

帖子 micro_cy » 2014-10-11 16:34

锁定不住用户在一个目录里面,杯具啊~
上次由 micro_cy 在 2014-10-13 16:14,总共编辑 2 次。
digimoon
帖子: 8
注册时间: 2009-06-26 14:49

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#9

帖子 digimoon » 2014-10-11 17:02

micro_cy 写了:chroot_local_user=YES
chroot_list_enable=NO


这句,要么同为YES,需要编辑chootlist文件,要么就同为NO,具体原因,自己百度一下。
这样的写法没有问题的,意思是说所有用户都锁定在用户目录不需要用list特别指明

已经找到问题了,是用db_load生成用户.db那文件的时候出错没注意到,用户密码那个文件转换时候对换行符之类的比较有要求
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#10

帖子 micro_cy » 2014-10-13 16:05

digimoon 写了:
micro_cy 写了:chroot_local_user=YES
chroot_list_enable=NO


这句,要么同为YES,需要编辑chootlist文件,要么就同为NO,具体原因,自己百度一下。
这样的写法没有问题的,意思是说所有用户都锁定在用户目录不需要用list特别指明

已经找到问题了,是用db_load生成用户.db那文件的时候出错没注意到,用户密码那个文件转换时候对换行符之类的比较有要求
chroot_local_user=YES
chroot_list_enable=NO
如果这样写的话,意思是你说的,如果
chroot_local_user=NO
chroot_list_enable=YES
这样写的话,似乎list里面设置的用户就称为排除用户了,意思就是说,虽然是不锁定用户在自己的文件夹里,但是list里面的用户被锁定,不知道对不对
chroot_local_user=YES 这句我就是设置了,我的虚拟用户也不能被锁定到他自己的文件夹,帮我分析一下原因
digimoon
帖子: 8
注册时间: 2009-06-26 14:49

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#11

帖子 digimoon » 2014-10-15 22:10

micro_cy 写了:
digimoon 写了:
micro_cy 写了:chroot_local_user=YES
chroot_list_enable=NO


这句,要么同为YES,需要编辑chootlist文件,要么就同为NO,具体原因,自己百度一下。
这样的写法没有问题的,意思是说所有用户都锁定在用户目录不需要用list特别指明

已经找到问题了,是用db_load生成用户.db那文件的时候出错没注意到,用户密码那个文件转换时候对换行符之类的比较有要求
chroot_local_user=YES
chroot_list_enable=NO
如果这样写的话,意思是你说的,如果
chroot_local_user=NO
chroot_list_enable=YES
这样写的话,似乎list里面设置的用户就称为排除用户了,意思就是说,虽然是不锁定用户在自己的文件夹里,但是list里面的用户被锁定,不知道对不对
chroot_local_user=YES 这句我就是设置了,我的虚拟用户也不能被锁定到他自己的文件夹,帮我分析一下原因

代码: 全选

# 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().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
配置文件里面是这么写的,chroot_local_user是YES的话那么list就是 不锁定 用户
我猜应该是指:
如果chroot_local_user和chroot_list_enable都是YES,那么列表里的用户就是 不锁定 用户,又因为list设成了YES的关系所以一定要有一个list文件
如果你想某个用户 不锁 的话应该在list里面标明,如果想所有用户都锁的话就将列表留空或者直接设NO
暂时没有条件测试,你可以试一下
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#12

帖子 micro_cy » 2015-03-09 10:12

经过一段时间的测试,本人总结了几点容易出错的地方:
1、PAM验证,pam验证的时候,设置的pam路径出错,pam的名称出错,dbload的版本不匹配,这个似乎是最容易遗漏的问题

2、#chroot_local_user=YES,#chroot_list_enable=YES,这两个设置的有问题,也容易出差错,要注意看FTP客户端的提示信息。

3、ftpd.cfg的配置文件中,尽量关闭无用的参数,用笨办法以后再逐渐增加;
以下是已经调试成功的配置文件:

代码: 全选

# Example config file /etc/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.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# Useful to not write over hidden files:
#force_dot_files=YES
# Connection limit for each IP:
max_per_ip=20
# Maximum number of clients:
max_clients=200
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
# instead of an IPv4 one. This parameter and the listen parameter are mutually
# exclusive.
#listen_ipv6=YES
#
# Allow anonymous FTP? (Disabled by default)
##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
allow_writeable_chroot=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=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.
dirmessage_enable=YES
#
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES
#
# Activate logging of uploads/downloads.
#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=overlord
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
log_ftp_protocol=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
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
#
# 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.
#dual_log_enable=YES
#vsftpd_log_file=/var/log/vsftpd.log
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner="Welcome To CCC SQ FTP SERVER 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 restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# 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().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=NO
#锁定用户在自己的目录,所有用户
chroot_list_enable=YES
#list列表里面的标记的用户才会被锁定在自己的目录local_root
#
#ssl_enable=YES
#allow_anon_ssl=NO
#force_local_data_ssl=YES
#force_local_logins_ssl=YES
#ssl_tlsv1=YES
#ssl_sslv2=YES
#ssl_sslv3=YES
# Filezilla uses port 21 if you don't set any port
# in Servertype "FTPES - FTP over explicit TLS/SSL"
# Port 990 is the default used for FTPS protocol.
# Uncomment it if you want/have to use port 990.
# listen_port=99
#
#
##local_root=/home/overlord/$USER (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=YES
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
#userlist_enable=NO
##此选项被激活后vsftpd将读取userlist_file参数所指定的文件中的用户列表。当列表中的用户登录FTP服务器时该用户在提示输入密码之前就被禁止了。即该用户名输入后vsftpd查到该用户名在列表中vsftpd就直接禁止掉该用户不会再进行询问密码等后续步聚 
#userlist_deny=YES 
##决定禁止还是只允许由userlist_file指定文件中的用户登录FTP服务器。此选项在userlist_enable 选项启动后才生效。YES默认值禁止文件中的用户登录同时也不向这些用户发出输入密码的提示。NO只允许在文件中的用户登录FTP服务器 
tcp_wrappers=YES
##是否允许tcp_wrappers管理
#userlist_file=/etc/vsftpd.user_list
local_root=/var/www/html/download
#所有用户的根目录对匿名用户无效 
#
pasv_promiscuous=YES
pasv_min_port=12000
pasv_max_port=12100
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
guest_enable=YES
guest_username=overlord
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/vconf/
#user_sub_token=$USER
hide_ids=YES
#
pam.d/vsftpd

代码: 全选

#%PAM-1.0
auth    sufficient      pam_userdb.so     db=/etc/vsftpd/virtusers
account sufficient      pam_userdb.so     db=/etc/vsftpd/virtusers
# Standard behaviour for ftpd(8).
auth	required	pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

# Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so.

# Standard pam includes
@include common-account
@include common-session
@include common-auth
auth	required	pam_shells.so
dbload我使用的好像是4,这个可以测试一下,一个版本不低,可以使用较高的版本。那个pam的路径不用写的很全,如果写的全的话,要注意是lib还是lib64
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#13

帖子 micro_cy » 2015-08-22 17:10

开启SSL以后~手机使用3G可以登录,同网段可以登录,回家以后用家里的电脑,有个路由器,没有什么特别的设置,登陆不了~不知道什么原因~
代码如下:

代码: 全选

# Turn on SSL
ssl_enable=YES
# Allow anonymous users to use secured SSL connections
allow_anon_ssl=YES
# All non-anonymous logins are forced to use a secure SSL connection in order to
# send and receive data on data connections.
force_local_data_ssl=NO
force_anon_data_ssl=NO
# All non-anonymous logins are forced to use a secure SSL connection in order to send the password.
force_local_logins_ssl=YES
force_anon_logins_ssl=YES
# Permit TLS v1 protocol connections. TLS v1 connections are preferred
ssl_tlsv1=YES
# Permit SSL v2 protocol connections. TLS v1 connections are preferred
ssl_sslv2=YES
# permit SSL v3 protocol connections. TLS v1 connections are preferred
ssl_sslv3=YES
# Disable SSL session reuse (required by WinSCP)
require_ssl_reuse=YES
# Select which SSL ciphers vsftpd will allow for encrypted SSL connections (required by FileZilla)
ssl_ciphers=HIGH
#require_cert=NO
#validate_cert=NO
#assl_request_cert=YES
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
# Filezilla uses port 21 if you don't set any port
# in Servertype "FTPES - FTP over explicit TLS/SSL"
# Port 990 is the default used for FTPS protocol.
# Uncomment it if you want/have to use port 990.
#listen_port=990
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
#rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_cert_file=/etc/vsftpd/vsftpd.pem
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
#rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#rsa_private_key_file=/etc/vsftpd/vsftpd.pem
如果关闭了SSL,一切就都正常了。客户端用的fillzilla~
micro_cy
帖子: 104
注册时间: 2011-07-20 11:33

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#14

帖子 micro_cy » 2015-08-22 17:10

开启SSL以后~手机使用3G可以登录,同网段可以登录,回家以后用家里的电脑,有个路由器,没有什么特别的设置,登陆不了~不知道什么原因~
代码如下:

代码: 全选

# Turn on SSL
ssl_enable=YES
# Allow anonymous users to use secured SSL connections
allow_anon_ssl=YES
# All non-anonymous logins are forced to use a secure SSL connection in order to
# send and receive data on data connections.
force_local_data_ssl=NO
force_anon_data_ssl=NO
# All non-anonymous logins are forced to use a secure SSL connection in order to send the password.
force_local_logins_ssl=YES
force_anon_logins_ssl=YES
# Permit TLS v1 protocol connections. TLS v1 connections are preferred
ssl_tlsv1=YES
# Permit SSL v2 protocol connections. TLS v1 connections are preferred
ssl_sslv2=YES
# permit SSL v3 protocol connections. TLS v1 connections are preferred
ssl_sslv3=YES
# Disable SSL session reuse (required by WinSCP)
require_ssl_reuse=YES
# Select which SSL ciphers vsftpd will allow for encrypted SSL connections (required by FileZilla)
ssl_ciphers=HIGH
#require_cert=NO
#validate_cert=NO
#assl_request_cert=YES
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
# Filezilla uses port 21 if you don't set any port
# in Servertype "FTPES - FTP over explicit TLS/SSL"
# Port 990 is the default used for FTPS protocol.
# Uncomment it if you want/have to use port 990.
#listen_port=990
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
#rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_cert_file=/etc/vsftpd/vsftpd.pem
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
#rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#rsa_private_key_file=/etc/vsftpd/vsftpd.pem
如果关闭了SSL,一切就都正常了。客户端用的fillzilla~
pengsir
帖子: 137
注册时间: 2015-07-24 8:29
系统: ubuntu

Re: 求助:::Ubuntu 14.04 桌面版 VSFTPD调试死活不成功

#15

帖子 pengsir » 2015-08-23 9:44

proftpd比vsftpd更加稳定好用。换成proftpd,我的经验
回复