Linux vsftpd服务配置具体解释
【背景】
近日。一朋友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服务配置具体解释的更多相关文章
- Linux vsftpd服务配置以及三种验证方式以及常见错误解决办法
文件传输协议(FTP): 文件传输协议(FTP,File Transfer Protocol),即能够让用户在互联网中上传.下载文件的文件协议,而FTP服务器就是支持FTP传输协议的主机,要想完成文件 ...
- linux vsftpd 服务配置
vsftpd.conf配置如下: # Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings ...
- Linux vsftpd服务
vsftpd服务 由vsftpd包提供 不再由xinetd管理 用户认证配置文件:/etc/pam.d/vsftpd 服务脚本: /usr/lib/systemd/system/vsftpd.serv ...
- Linux ISCSI服务配置
Linux ISCSI服务配置,客户端进行访问 环境配置: server端 172.25.0.11 client端 172.25.0.10 配置ISCSI服务端 1.安装软件包 yum install ...
- Kali Linux常用服务配置教程获取IP地址
Kali Linux常用服务配置教程获取IP地址 下面以Kali Linux为例,演示获取IP地址的方法 (1)设置网络接口为自动获取IP地址.在Kali Linux的收藏夹中单击图标,将显示所有的程 ...
- Kali Linux常用服务配置教程启动DHCP服务
Kali Linux常用服务配置教程启动DHCP服务 通过前面的介绍,DHCP服务就配置好了.接下来,用户就可以使用该服务器来获取IP地址了.下面将对前面配置的服务进行测试. 1.启动DHCP服务 如 ...
- Kali Linux常用服务配置教程安装及配置DHCP服务
Kali Linux常用服务配置教程安装及配置DHCP服务 在Kali Linux中,默认没有安装DHCP服务.下面将介绍安装并配置DHCP服务的方法. 1.安装DHCP服务 在Kali Linux中 ...
- Kali Linux常用服务配置教程DHCP服务原理
Kali Linux常用服务配置教程DHCP服务原理 动态主机配置协议(Dynamic Host Configuration Protocol,简称DHCP)是一个局域网的网络协议,基于UDP协议工作 ...
- VsFtpd服务配置简明笔记
Ftp服务是最常用的文件传输方式,把配置步骤记录下来,以备将来使用. 1.用YUM安装VsFtpd服务:[root@Redis usr]# yum install vsftpd 2.安装完成后启动Vs ...
随机推荐
- Vijos 1493 传纸条
此题,刚开始看上去以为是加简单的动态规划,但是写了后,交上去发自现不对.后来在网上查了题解后发现用到了“多线程DP”的东西.这种DP就是用来解决这种问题的.和P1143 三取方格数那道题很像.只不过是 ...
- 为什么Java项目前会出现一个红色感叹号!
先看看问题,如下图所示: 造成这个问题的原因是,我把一个 jar 包删除了,然后又配了个新的进去,然后就一直有这个错误,刚开始很郁闷,怎么已经配置过儿,还出现这个问题?关键是代码里面没有报错的.郁闷的 ...
- MVC进阶之路:依赖注入(Di)和Ninject
MVC进阶之路:依赖注入(Di)和Ninject 0X1 什么是依赖注入 依赖注入(Dependency Injection),是这样一个过程:某客户类只依赖于服务类的一个接口,而不依赖于具体服务类, ...
- 编程实现Windows系统自动登录
编程实现Windows系统自动登录 原理: 通过注册表修改实现.Windows内置了自动登录的机制,在登录系统时,winlogon会检查注册表下有没有设置自动登录,如果设置了就上就会读取用户名和密码, ...
- BZOJ 1103 [POI2007]大都市meg(树状数组+dfs序)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1103 [题目大意] 给出一棵树,每条边的经过代价为1,现在告诉你有些路不需要代价了, ...
- Java程序猿的JavaScript学习笔记(8——jQuery选择器)
计划按例如以下顺序完毕这篇笔记: Java程序猿的JavaScript学习笔记(1--理念) Java程序猿的JavaScript学习笔记(2--属性复制和继承) Java程序猿的JavaScript ...
- UIView 中bounds和frame的差别
搞iOS开发的童鞋基本都会用过UIView,那他的bounds和frame两个属性也不会陌生,那这两个有什么实质性的区别呢? 先看到下面的代码你肯定就明白了一些: -(CGRect)frame{ ...
- xcode UIView常用方法属性动画
常见属性: @property(nonatomic,readonly) UIView *superview; 获得自己的父控件对象 @property(nonatomic,readonly,copy) ...
- hasOwnProperty和isPrototypeOf方法使用
hasOwnProperty():判断对象是否有某个特定的属性.必须用字符串指定该属性.(例如,o.hasOwnProperty("name")) //复制自w3cschool ...
- ztree树形插件
在开发项目中需要用到树插件,近期研究了几款树插件,好记性不如烂笔头 ,写下来 以后好查 MzTreeView(梅花雪) 很经典的树形菜单脚本控件 菜单树展示加载速度快 支持1w条以上大数据 缺点-- ...