阿里云ECS CentOS7.3 vsftpd 安装、配置、卸载

一、卸载

1、查看当前服务器中的vsftpd

rpm -qa|grep vsftpd

例如结果为:vsftpd-2.2.2-13.el6_6.1.x86_64

2、执行卸载

rpm -e vsftpd-2.2.2-13.el6_6.1.x86_64

返回:卸载时自动备份vsftp的用户列表文件

warning: /etc/vsftpd/vsftpd.conf saved as /etc/vsftpd/vsftpd.conf.rpmsave
warning: /etc/vsftpd/user_list saved as /etc/vsftpd/user_list.rpmsave

3、删除遗留的文件

rm -rf /etc/vsftpd

二、安装

yum -y install vsftpd

三、配置

1、修改配置文件,/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).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
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.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
#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
#
# 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/xferlog
#
# 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
#
# 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().
# (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
#
# 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. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then 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
userlist_deny=NO
#这个是ftp根目录,根据你自己的情况配置
local_root=/var/ftp
tcp_wrappers=YES
use_localtime=YES

2、增加FTP账户

useradd ftpadmin -s /sbin/nologin

给ftpadmin设置密码

passwd ftpadmin

输入两遍密码即可

2.1、如果出现 useradd: user 'ftpadmin' already exists,说明用户已经存在,需要先删除,否则还可能登陆不了。

删除用户

userdel ftpadmin

查找遗留的文件和目录

find / -name ftpadmin

例如出来结果:

/var/spool/mail/ftpadmin
/home/ftpadmin

哪个要删,哪个不要删,看清楚目录再删除,谨慎使用删除命令,否则遗憾多久就不知道了

rm -rf  /var/spool/mail/ftpadmin
rm -rf  /home/ftpadmin

3、修改/etc/vsftpd/user_list文件,最后一行添加刚才创建的用户名ftpadmin,也可以整个覆盖

# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
#这个就是刚才创建的那个,根据你自己的情况来
ftpadmin

4、创建FTP根目录

mkdir /var/ftp

如果上述目录已经存在,只需要修改权限即可

chown -R ftpadmin /var/ftp
chmod -R 755 /var/ftp

5、设置开机启动

chkconfig --level 35 vsftpd on

到此,安装配置完毕,重新启动vsftpd服务

service vsftpd restart

就可以使用FlashFXPE或者FileZilla登陆FTP了。

下面以FileZilla为例,看图片

时间: 2024-09-18 12:57:03

阿里云ECS CentOS7.3 vsftpd 安装、配置、卸载的相关文章

阿里云ecs服务器实例如何选择配置?(最详细教程)

阿里云ecs服务器实例如何选择配置? 购买前请先领取阿里云幸运券随机优惠还能百分百中奖小米电源一个!幸运的话中一等奖还能获得iPad mini. 1.阿里云ecs服务器实例地域配置: 计费方式建议选择"包年包月" 2.阿里云ecs服务器实例地域配置: 阿里云节点地区所对应的城市如下: 华北1:青岛 华北2:北京 华北3:张家口 华北5:呼和浩特 华东1:杭州 华东2:上海 华南1:深圳 华北地区:北京,天津,河北,山西,内蒙古. 华东地区:上海,江苏,浙江,山东,安徽. 华南地区:广东

阿里云ECS美国西部VPS主机配置及性能测试

我们用户对于阿里云ECS服务器应该还是比较了解的,正是因为这些大佬商家的出现,整个IDC市场都在进行重新洗牌,包括一些小的IDC服务商需要调整业务方向和产品项目.之前也有不少的网友和老左聊天,这些商家出现后如今IDC业务非常难做,不过还是有市场的,比如我们可以调整业务方向,注重口碑和品牌的维护,一定程度上降低利润.   在一定程度上,如今竞争激烈的市场对于我们用户而言选择度更广,对于商家来说无论是个人还是公司更需要提供细分市场服务,以及并不是这些大商家出现没有机会.比如今天老左要体验的是阿里云E

阿里云ECS CentOs7.3下搭建LAMP环境(Apache2.4 + Mysql5.7 + PHP5.6 + Laravel5.2)

硬件是阿里云服务器ECS,安装阿里云提供的系统Linux CentOs7.3.LAMP环境搭建,再安装Laravel5.2框架. 硬件没什么好说的,不是很懂,买就是了. 至于系统为什么选择CentOs? 因为CentOs是公认的,个人服务器最合适的系统. 为什么选择7.3版本? 两个原则: 1.选公认的最稳定版本CentOs6.5,可惜阿里云默认的没有提供: 2.选最新的版本,因为已经修复以前的bug. 现在开始吧! LAMP安装有顺序:先安装Apache或Mysql,最后安装PHP. 1.安装

在阿里云的CentOS环境中安装配置MySQL的教程_Mysql

1 常规错误的yum安装方法: 在前文中记述了CentOS 6.5系统中通过yum方式快速地搭建了LNMP环境,那么是否也能在CentOS 7或CentOS 7.1系统中依葫芦画瓢安装MySql5.6.24呢?答案是否定的. [root@typecodes ~]# yum -y install mysql mysql-server mysql-devel ...................... ....省略部分安装过程.... ...................... Installe

阿里云ECS服务器升级配置、提前续费、重装系统常见应用记录

如今阿里云在IDC圈中的影响力和产品的范围广度已经严重影响到很多主机商的利益,照着这样的趋势发展,不断的增加产品种类以及各种周边的服务延伸,很多国内的个人主机商.企业类的主机商肯定需要调整原有的营销和产品模式.但是对于大部分用户来说,增加的竞争会使得我们降低成本,比如如今选择虚拟主机.VPS服务器等相对来说价格还是比较便宜.   老蒋手中有两台当初阿里云ECS服务器512MB内存方案配置,不过目前最低的配置方案是1GB内存方案,相对来说老配置方案比较难得且需要保留的,但是觉得两台机器有点浪费.老

阿里云ecs服务器中安装部署node.js的步骤_node.js

首先下载了putty用来连接服务器的控制台,还有flashFXP用来上传文件.下面是详细的步骤,一起来看看. 1.下载node.js 下载地址:node.js 千万不要用命令行下载,太慢. 下载完成后上传至服务器. 2.解压 进入到node.js安装包的目录,然后输入命令: tar zxf node-latest.tar.gz 3.编译 进入解压后的文件夹 输入命令: ./configure 多等一会 再输入命令: make 4.安装 命令: make install 再等一会. 结束后,输入

阿里云ECS服务器CentOS7上安装Apache服务

阿里云ECS服务器CentOS7上安装Apache服务 ---------------------------------------------- 使用root登录 1.确保服务器系统处于最新状态 [root@localhost ~]# yum -y update 如果显示以下内容说明已经更新完成 Replaced:   grub2.x86_64 1:2.02-0.64.el7.centos   grub2-tools.x86_64 1:2.02-0.64.el7.centos        

常见问题:阿里云ECS云服务器怎么安装配置SSL证书

在阿里云-ECS云服务器上部署ssl证书之前,我们需先下载应用软件amssl,下载完毕之后,点击面板右上角的应用软件.接下来是配置证书模版. sslz  阿里云湖北服务中心:武汉捷讯信息技术有限公司 配置证书模板 在应用软件区域找到刚刚下载好的amssl,点击证书管理.首先创建一个证书模板,环境选择Inmpssl,证书名称,备注说明填写任意好记的名称,点击创建.创建完毕,在出现的SSL模板后面点击配置. amssl证书 成功在景安申请证书后,会得到一个有密码的压缩包文件,输入证书密码后解压得到五

阿里云ECS服务器CentOS7上安装MySql服务

阿里云ECS服务器CentOS7上安装MySql服务 ---------------------------------------------- 使用root登录 1.确保服务器系统处于最新状态 [root@localhost ~]# yum -y update 如果显示以下内容说明已经更新完成 Replaced:   grub2.x86_64 1:2.02-0.64.el7.centos   grub2-tools.x86_64 1:2.02-0.64.el7.centos Complete