Centos安装FTP服务

1、安装FTP

# yum check-update
# yum -y install vsftpd

2、配置参数

# vi /etc/vsftpd/vsftpd.conf

3、参数

# 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=YES
#
# 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
#
# 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
anon_umask=022
# 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
tcp_wrappers=YES

4、创建用户

# useradd vsftpd -s /sbin/nologin
# passwd vsftpd

5、编辑user_list文件 加入vsftpd

# vi /etc/vsftpd/user_list

6、设置根目录访问权限

# cd /home
# chmod -R 777 vsftpd/

7、防火墙设置

#service firewalld start ----> 启动防火墙
#service firewalld restart ----> 重启防火墙
#service firewalld stop -----> 关闭防火墙
#firewall-cmd --query-port=21/tcp ----->查询端口是否开放
#firewall-cmd --permanent --add-port=21/tcp ----->开放21端口
#firewall-cmd --permanent --remove-port=21/tcp ----->移除端口
#firewall-cmd --reload  ----->重启防火墙(修改配置后要重启防火墙)

8、启动FTP

# service vsftpd start
# systemctl status vsftpd.service #查看vsftpd服务状态
# systemctl restart vsftpd.service #重启vsftpd服务

9、设置开机启动

# chkconfig vsftpd on

  

原文地址:https://www.cnblogs.com/Q827170326/p/9197687.html

时间: 2024-07-31 15:13:02

Centos安装FTP服务的相关文章

Centos 安装FTP配置目录权限,iptables设置ftp服务

Centos 安装FTP配置目录权限,iptables设置ftp服务 2012-07-06 admin Leave a comment Go to comments CentOS 安装vsftpd,设置Iptables 限制用户访问自己目录 安装好vsftpd后,打开配置文件: [root@hexuweb101 ~]$vi /etc/vsftpd/vsftpd.conf 1 [root@hexuweb101 ~]$vi /etc/vsftpd/vsftpd.conf 把下面几行注释去掉,让其配置

Centos安装nginx服务

到http://nginx.org/en/download.html下载最新版本的Nginx并安装. 一 下载并安装pcre库ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ tar zxvf pcre-8.30.tar.gz ./configure     make    make install 二 安装openssl yum -y install openssl openssl-devel 三 下载tcp_proxy_module

centos 安装FTP server详情(转)

centos 安装FTP server详情 分类: linux 2013-12-27 16:45 227人阅读 评论(0) 收藏 举报 我们这里以安装vsftpd 服务器端为例子: 1.进入到centos 终端上 首先执行 yum search vsftpd 查看安装软件名字; 2.然后安装 列出来的软件名,首选第一个 yum install vsftpd,开始执行安装 3.安装好后通过 service vsftpd status 查看ftp 运行状态 如果没运行 可以使用 service vs

基于CentOS安装FTP服务器

操作系统环境: CentOS Linux release 7.4.1708 (Core) 使用yum安装ftp服务: yum install -y vsftpd 添加系统用户作为登录ftp服务器并修改ftp配置文件: [[email protected] ~]# useradd ftp1 -s /sbin/nologin -d /ftp_data && echo "123456"|passwd ftp1 --stdin #添加用户并设置访问的ftp目录[[email p

【CNMP系列】CentOS7.0下安装FTP服务

一个小插曲,安装一个FTP服务,便于和远程服务器的文件沟通.后续我们会讲到如何使用Capistrano配合git完成服务器的代码部署以及发布流程.现在,代码先走FTP吧,挺稳. FTP简介 FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为"文传协议". 在FTP的使用当中,用户经常遇到两个概念:"下载"(Download)和"上传"(Upload)."下载"文件就是从远程主机拷贝文

centos 安装memcache服务后memcahce本机连接Permission

自己手动在虚拟机下装了下memcache,整个过程真是充满波折,本身用php5.3安装memcache扩展就麻烦很多,无法通过yum直接安装,安装方法详见http://chenwei.me/blog/server/69.html,接下来安装memcache服务,安装成功后,telnet可以成功,不过好像不是立即成功生效,过一会用stats才会有详细显示. 本机用 <?php $mem = new Memcache; $mem->connect(‘192.168.124.129′,11211)

Ubuntu下安装FTP服务及使用(VSFTPD详细设置)(二)

vsftpd 作为一个主打安全的FTP服务器,有很多的选项设置.下面介绍了vsftpd的配置文件列表,而所有的配置都是基于vsftpd.conf这个配置文件 的.本文将提供完整的vsftpd.conf的中文说明.学习本文的内容将有助于你初步了解vsftpd的配置文件,但针对具体情况还需要制定具体的配置 方法. Vsftpd的配置文件: /etc/vsftpd/vsftpd.conf 主配置文件 /usr/sbin/vsftpd Vsftpd 的主程序 /etc/rc.d/init.d/vsftp

Ubuntu下安装FTP服务及使用(以VSFTPD为例)

(一)安装与配置 (1)       安装vsftpd $sudo apt-get install vsftpd 这里会提示无法创建/home/ftp目录,手动创建一个 $sudo mkdir /home/ftp 如果提示已创建目录就不用理它了 (2)       编辑配置文件/etc/vsftpd.conf $sudo gedit /etc/vsftpd.conf 也可以使用vi 主要配置: 将local_enable=YES前的#去掉,使其可用,表示允许本地用户登录: 将anonymous_

Linux安装FTP服务

转自:http://blog.csdn.net/huangbiao86/article/details/6641952 ftp服务器 1.  在Linux和其他机器之间共享文件(在linux下安装ftp) 2.  具体安装步骤: a)        首先查看我的Redhat5上是否已经安装 rpm -qa|grep vsftpd b)        查看服务的运行状态: Service iptables status c)        安装. 如果没有安装话,就要选择一种方式安装 i.