【背景】

近日。一朋友dominoserver要进行升级、迁移,搭建了linux測试系统,也开启vsftpd服务,但是配置的ftp账号,程序无法正常下载附件。

【问题跟踪】

通过ftpclient连接工具登录。发现未跳转到ftp账号指定的文件夹以下。

cat /etc/vsftpd.config发现开启了:

          local_root=/home/test

将此凝视重新启动ftp服务正常。

附录(vsftpd配置具体解释):

vsftpdserver配置文件“/etc/vsftpd/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).

#  ####——是否同意匿名用户登录此FTPserver。默认下是“YES”同意登录。

anonymous_enable=YES



#

# Uncomment this to allow local users to log in.

#  ####——是否同意本地用户登录此FTPserver。默认下是“YES”同意登录。

local_enable=YES

#

#

# Uncomment this to enable any form of FTP write command.

#  ####——是否同意本地登录用户具有“写入”的权限。默认下是“YES”同意。

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)

#  ####——设置本地用户的文件生成掩码为022。默觉得077

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.

#  ####——是否同意匿名登录用户具有“上传”的权限。默认下是“YES”同意。当须要启用时须要将此句前面的“#”去掉就可以。

#anon_upload_enable=YES

#

#

# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.

#  ####——是否同意匿名登录用户具有“创建文件夹”的权限。

默认下是“YES”同意。当须要启用时须要将此句前面的“#”去掉就可以。

#anon_mkdir_write_enable=YES

#

#

# Activate directory messages - messages given to remote users when they  

# go into a certain directory.

#  ####——激活文件夹信息,当远程用户更改文件夹时,将出现提示信息。

dirmessage_enable=YES

#

#

# Activate logging of uploads/downloads.

#  ####——启用上传和下载日志功能。

xferlog_enable=YES

#

#

# Make sure PORT transfer connections originate from port 20 (ftp-data).

#  ####——启用FTPserver数据port的连接请求。

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.

#  ####——设置日志文件的文件名称及存储路径。默认是/var/log/vsftpd.log。启用时须要将此句前面的“#”去掉。

#xferlog_file=/var/log/vsftpd.log

#

#

# If you want, you can have your log file in standard ftpd xferlog format

#  ####——是否使用标准的ftpd xferlog日志文件格式。默认是启用的。

xferlog_std_format=YES

#

#

# You may change the default value for timing out an idle session.

#  ####——设置空暇的用户会话中断时间,默认是10分钟。启用时须要将此句前面的“#”去掉。

#idle_session_timeout=600

#

#

# You may change the default value for timing out a data connection.

#  ####——设置连接超时的时间。默认是120秒。

启用时须要将此句前面的“#”去掉。

#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格式上传和下载文件。默认下是“YES”同意。当须要启用时须要将此句前面的“#”去掉就可以。

#ascii_upload_enable=YES

#ascii_download_enable=YES

#

#

# You may fully customise the login banner string:

#  ####——设置FTP用户登录server时显示的欢迎信息。

当须要启用时须要将此句前面的“#”去掉就可以。

#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().

#  ####——假设希望用户登录后不能切换到自己文件夹以外的其它文件夹,须要去掉此句前面的“#”,启用此句。假设启用此项功能,那么仅仅同意/etc/vsftpd.chroot_list中列出的用户具有该功能。假设希望全部的本地用户都具有此功能。能够在后面添加一行代码: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


#



#  ####——设置PAM认证服务的配置文件名,该文件存放在/etc/pam.d/文件夹下。

pam_service_name=vsftpd

#  ####——用户列表中的用户是否同意登录到FTPserver。默认是不同意。

userlist_enable=YES

#enable for standalone mode

#  ####——使vsftpd处于独立启动模式。

listen=YES

#  ####——使用tcp_wrappers作为主机訪问控制方式。

tcp_wrappers=YES   

####——额外配置

#

#

#  ####——设置连接server的最大并发连接数和用户的最大线程

#max_clients=100      //设置同一时候连接FTPserver的并发用户为100

#max_per_ip=2         //设置每用户同一时段并发下载线程数为2,同一时候仅仅可下面载两个文件

#

#

#  ####——设置匿名用户和本地用户的最大传输速率

#anon_max_rate=20000     //设置匿名用户的最大传输速率为20Kbps

#local_max_rate=1000000  //设置本地用户的最大传输速率为1Mbps

#

#

#  ####——禁止某些IP段的匿名用户訪问FTPserver

#首先确认配置文件/etc/vsftpd/vsftpd.conf中有例如以下语句且是启用的:

#tcp_wrappers=YES

#用gedit改动文件/etc/hosts.allow例如以下所看到的:

#hosts.allow This file describes the names of the hosts which are

#      allowed to use the local INET services,as decided

#      by the '/usr/sbin/tcpd' server.

vsftpd:192.168.1.9:DENY       //限制IP地址为192.168.1.9和192.168.1.12的主机訪问FTPserver,

vsftpd:192.168.1.12:DENY        切记,一定要在IP地址前面加上“vsftpd:”。

#

#

# ####——同意用户列表中的用户訪问FTPserver。其它不在列表中的用户禁止訪问

#userlist_enable=yes

#userlist_deny=NO

#userlist_file=/etc/vsftpd/user_list

#

#

# ####——更改FTPserver默认的port号和IP地址,在配置文件/etc/vsftpd/vsftpd.conf中加入例如以下语句(去除凝视符号):

#listen_port=5555       //指定serverport号为“5555”,注意:port号要尽量大于4000

#listen_address=192.168.0.3  //指定server监听的IP地址为192.168.0.3



# ####——基本操作命令

1、查询vsftpd是否安装命令   rpm -qa | grep vsftpd

2、关闭、启动、重新启动、状态命令

  /etc/rc.d/init.d/vsftpd stop|start|restart|status  

service vsftpd stop|start|restart|status # #  

server性能优化命令集:

One_process_model=YES  ——每一个IP单一进程模式

Idle_session_timeout=120  ——踢出空暇2分钟后的用户

Data_connection_timeout=300  ——踢出空暇5分钟后的下载

Accept_timeout=60   ——踢出挂起1分钟后的被动连接

Connect_timeout=60   ——踢出挂起1分钟后的活动连接

Anon_max_rate=50000   ——匿名用户最大传输速率为50kb/s 

匿名账户配置命令集:

anonymous_enable=YES           ——同意匿名账户登录

anon_mkdir_write_enable=YES      ——开启匿名账户创建文件夹和写入文件权限

anon_upload_enable=YES          ——开启匿名账户上传权限

anon_world_readable_only=NO      ——匿名账户不仅仅仅有下载权限

anon_umask=022                 ——新增文件的权限

anon_other_write_enable=NO       ——关闭匿名账户删除、改名权限

anon_max_rate=50000             ——限制最大传输速率

anon_root=/var/ftp/                ——设定匿名账户登录的根文件夹

no_anon_password=YES           ——匿名用户不用输入密码

ftp_username=test                 ——指定匿名账户的相应本地账户

chown_uploads=YES              ——匿名上传文件的属主为以下指定账户

chown_username=test              ——匿名上传文件的属主的账户 

本地账户配置命令集

local_enable=YES                     ——同意本地账户登录

write_enable=YES                     ——开启本地账户的写权限

local_umask=022                      ——新增文件的权限

chroot_local_enable=YES               ——本地账户不能切换到家文件夹之外

chroot_list_enable=YES                 ——同意某些本地账户能够切换到外面

chroot_list_file=/etc/vsftpd/chroot_list      ——同意切换到外面的本地账户列表

local_root=/home/test                   ——设定本地账户登录的根文件夹

chmod_enable=YES                    ——本地账户可改动文件权限(SITE CHMOD)

local_max_rate=1000000                ——本地账户的最大传输速率 

虚拟用户配置命令集

guest_enable=yes   ——启用虚拟用户

guest_username=ftp   ——指定虚拟用户映射的本地用户,默觉得ftp,能够更改



Linux vsftpd服务配置具体解释的更多相关文章

  1. Linux vsftpd服务配置以及三种验证方式以及常见错误解决办法

    文件传输协议(FTP): 文件传输协议(FTP,File Transfer Protocol),即能够让用户在互联网中上传.下载文件的文件协议,而FTP服务器就是支持FTP传输协议的主机,要想完成文件 ...

  2. linux vsftpd 服务配置

    vsftpd.conf配置如下: # Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings ...

  3. Linux vsftpd服务

    vsftpd服务 由vsftpd包提供 不再由xinetd管理 用户认证配置文件:/etc/pam.d/vsftpd 服务脚本: /usr/lib/systemd/system/vsftpd.serv ...

  4. Linux ISCSI服务配置

    Linux ISCSI服务配置,客户端进行访问 环境配置: server端 172.25.0.11 client端 172.25.0.10 配置ISCSI服务端 1.安装软件包 yum install ...

  5. Kali Linux常用服务配置教程获取IP地址

    Kali Linux常用服务配置教程获取IP地址 下面以Kali Linux为例,演示获取IP地址的方法 (1)设置网络接口为自动获取IP地址.在Kali Linux的收藏夹中单击图标,将显示所有的程 ...

  6. Kali Linux常用服务配置教程启动DHCP服务

    Kali Linux常用服务配置教程启动DHCP服务 通过前面的介绍,DHCP服务就配置好了.接下来,用户就可以使用该服务器来获取IP地址了.下面将对前面配置的服务进行测试. 1.启动DHCP服务 如 ...

  7. Kali Linux常用服务配置教程安装及配置DHCP服务

    Kali Linux常用服务配置教程安装及配置DHCP服务 在Kali Linux中,默认没有安装DHCP服务.下面将介绍安装并配置DHCP服务的方法. 1.安装DHCP服务 在Kali Linux中 ...

  8. Kali Linux常用服务配置教程DHCP服务原理

    Kali Linux常用服务配置教程DHCP服务原理 动态主机配置协议(Dynamic Host Configuration Protocol,简称DHCP)是一个局域网的网络协议,基于UDP协议工作 ...

  9. VsFtpd服务配置简明笔记

    Ftp服务是最常用的文件传输方式,把配置步骤记录下来,以备将来使用. 1.用YUM安装VsFtpd服务:[root@Redis usr]# yum install vsftpd 2.安装完成后启动Vs ...

随机推荐

  1. new,delete,malloc,free

    malloc/free是C语言中的内存申请和释放函数,利用它们可方便地管理内存.而在C++中我们又有了新的工具:new/delete.new/delete在管理内存的同时会调用类的构造函数和析构函数, ...

  2. TOJ 1702.A Knight's Journey

    2015-06-05 问题简述: 有一个 p*q 的棋盘,一个骑士(就是中国象棋里的马)想要走完所有的格子,棋盘横向是 A...Z(其中A开始 p 个),纵向是 1...q. 原题链接:http:// ...

  3. TOJ 1139.Compromise

    2015-06-03 问题简述: 大概就是输入两段文本(用小写英文字母表示),分别用#表示一段话的结束输入,输出这两个文本的最长公共子序列. 简单的LCS问题,但是输入的是一段话了,而且公共部分比较是 ...

  4. Linux学习之chage命令

    功能:修改帐号和密码的有效期限用法:chage[-l][-m mindays][-M maxdays][-I inactive][-E expiredate][-W warndays][-d last ...

  5. grunt打包过程中的注意点

    1.安装nodeJS   nodeJS下载地址: http://www.nodejs.org/download/ 2.   在Node.js command prompt 这个控制面板输入 npm i ...

  6. 一个给力的html5 画多边形的例子

    只需改变参数就能画出你想要的多边形,代码简单!不得不惊叹canvas的强大! 代码奉上 <!doctype html> <html> <head> <meta ...

  7. ios 刷新BUG

    UItextView edited = yes  ; 导致 刷新奇怪: 有些方法不要自己调用: 可能会破坏组件自己的生命周期: 建议模块化开发组件,自己处理自己的事:

  8. "笨方法学python"

    <笨方法学python>.感觉里面的方法还可以.新手可以看看... 本书可以:教会你编程新手三种最重要的技能:读和写.注重细节.发现不同.

  9. 20个经典bootsrtap后台html网站模板推荐

    今天为大家推荐20款不同风格的Bootstrap后台管理模板,每一款都经典可用,能预览和下载,保证让你挑得眼花缭乱. 1,Simpli flag蓝色 Simpli Flat蓝色管理模板是一款采用Fla ...

  10. poj 2228 Naptime dp

    这个题目的状态还是比较好想的,dp[i][j]表示已经睡了i个时段,最后睡在j时段的最优值,但是需要处理环的情况,我的做法是算两次,第一次不处理环,第二次强制性要求第一个时段需要睡,然后查看dp[m] ...