关键词:
一、安装VSFTP
# yum -y install vsftpd
注意提升权限:
#su root
二、配置vsftpd.conf 文件
-
[[email protected] ~]# vi /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=YES
-
#
-
# 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=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=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
-
#
-
# The target log file can be vsftpd_log_file or xferlog_file.
-
# This depends on setting xferlog_std_format parameter
-
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
-
#
-
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
-
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
-
#xferlog_file=/var/log/xferlog
-
#
-
# Switches between logging into vsftpd_log_file and xferlog_file files.
-
# NO writes to vsftpd_log_file, YES to xferlog_file
-
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 lightnear 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().
-
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. To listen on IPv4 and IPv6
-
# sockets, 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
-
local_root=/var/public_root
-
tcp_wrappers=YES
-
use_localtime=YES
三、增加FTP账号
-
[[email protected] ~]# useradd ftpuser -s /sbin/nologin
-
[[email protected] ~]# passwd ftpuser
ftpuser为账户名,passwd的作用为重设ftpuser的密码。
四、编辑user_list文件,允许cent用户访问
# vi /etc/vsftpd/user_list
-
# 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
-
ftpuser
五、建立我们的根目录,并设置访问权限
-
# mkdir /var/public_root
-
# chown -R cent /var/public_root
-
# chmod -R 755 /var/public_root
六、开启vsftpd服务
-
# service vsftpd start
-
Starting vsftpd for vsftpd: [ OK ]
七、开启21端口
#vi /etc/sysconfig/iptables
在上面有行22 -j ACCEPT ,在下面照打一遍,但是把22改成21。改完之后,重启iptables。
#service iptables restart
八、修改selinux
#getsebool -a | grep ftp
执行上面命令,可以看到
-
....
-
allow_ftpd_full_access off
-
....
-
....
-
ftp_home_dir off
将这两个权限都打开
-
#setsebool -P allow_ftpd_full_access 1
-
#setsebool -P ftp_home_dir 1
重启下vsftpd
#service vsftpd restart
设置成默认开启。
# chkconfig vsftpd on
centos6.8防火墙配置(代码片段)
系统:CentOSrelease6.8(Final) 执行命令:#清除所有规则iptables-F#开放redis端口iptables-AINPUT-ptcp-mtcp--dport3379-jACCEPT#开放MySql端口iptables-AINPUT-ptcp-mtcp--dport3306-jACCEPT#开放WebServer端口iptables-AINPUT-ptcp-mtc 查看详情
centos8.1配置vsftp和yum(代码片段)
使用vsftp配置本地yum源1、安装vsftp使用vmware安装好CentOS8.1后,开机会自动挂载,此时进入挂载目录下的AppStream/Packages下,执行以下命令安装vsftprpm-ivhvsftpd-3.0.3-28.el8.x86_64.rpm修改配置文件/etc/vsftpd/vsftpd.conf的anonymous_enable=NO为anonymous_... 查看详情
centos6.8下搭建svn及使用(代码片段)
查看系统环境(1)查看系统版本[[email protected]~]#cat/etc/redhat-releaseCentOSrelease6.8(Final)(2)查看系统全部信息[[email protected]~]#uname-aLinuxnode-0052.6.32-642.15.1.el6.x86_64#1SMPFriFeb2414:31:22UTC2017x86_64x86_64x86_64GNU/Linux(3)查看系统内核[[e... 查看详情
centos6.8下实现配置配额
CentOS6.8下实现配置配额 Linux系统是支持多用户的,即允许多个用户同时使用linux系统,普通用户在/home/目录下均有自己的家目录,在默认状态下,各个用户可以在自己的家目录下任意创建文件,而不用担心内存。作为系统管... 查看详情
centos6.8安装ftp及添加用户(代码片段)
一安装FTP1检测是否已经安装FTPrpm-qa|grepvsftpd2若没有,则进行安装yuminstallvsftpd二设置vsftpd开机启动chkconfig--level35vsftpdon三配置FTP服务器(开启基于用户的访问控制)1配置文件的修改vim/etc/vsftpd/vsftpd.confanonymous_enable=NO#是否开启匿名... 查看详情
vsftp配置使用(代码片段)
...的数据,VSFTP服务器可以支持15000个并发用户。vsftp的安装配置:安装vsftp需要用到root权限,尽可能的在root用户下进行安装切换root权限sudosu-1.检查vsftp是否安装rpm-qavsftp[无结果表明没有安装]2.安装vsftpyuminstall-yvsftpd[root@m01~]#yuminstal... 查看详情
centos6.8下没有yum命令解决方法(报错:-bash:yum:commandnotfound)(代码片段)
1、去http://mirrors.163.com/centos/6/os/x86_64/Packages/地址下载4个rpm安装包:python-iniparse-0.3.1-2.1.el6.noarch.rpmyum-3.2.29-81.el6.centos.noarch.rpmyum-metadata-parser-1.1.2-16.el6.x86_64.rpmyum-plugin-fast 查看详情
centos6.8下网卡配置桥接模式和nat连接模式vmware虚拟机克隆网卡配置(代码片段)
模式一:桥接模式:1.在VMware中安装好虚拟机后,虚拟机网卡设置:选择桥接模式2.查看本机的网络信息:找到ip、子网掩码、网关、DNS等。找一个没有使用的ip,例如:192.168.135.58,本机ping一下,若ping不通即没有被使用,则可以... 查看详情
centos6.8下设置gitlab服务开机自启动,关闭防火墙开机自启动(代码片段)
一.本地虚拟机的缺点本地虚拟机虽然也可以模拟服务器用,但电脑不能保证24小时都是开机的,一旦关机,服务就失去了连接,你将看到我们之前搭建的gitlab服务出现如下画面:本地电脑7*24小时不关机是不现实的,但是可以保... 查看详情
centos8.1配置vsftp和yum(代码片段)
使用vsftp配置本地yum源1、安装vsftp使用vmware安装好CentOS8.1后,开机会自动挂载,此时进入挂载目录下的AppStream/Packages下,执行以下命令安装vsftprpm-ivhvsftpd-3.0.3-28.el8.x86_64.rpm修改配置文件/etc/vsftpd/vsftpd.conf的anonymous_enable=NO为anonymous_... 查看详情
lvs_dr模式构建配置(代码片段)
一、环境准备lvs负载均衡器 系统:centos6.8 ip:192.168.2.203 vip:192.168.2.17web服务器RS1 系统:centos6.8 ip:192.168.2.204web服务器RS2 系统:centos6.8 ip:192.168.2.204 二、安装LVS软件可以编译安装... 查看详情
centos6.8的安装和配置(代码片段)
...7-7xxx标压以上,内存16G及以上自行搜索,下载,安装VMWare准备CentOS6.8的镜像文件注意:安装虚拟机前必须开启BIOS虚拟化支持 安装CentOS 右键刚刚创建好虚拟机,在菜单中选择"设置"选项 鼠标切换:Ctrl+Alt... 查看详情
vsftp搭建(代码片段)
...ld或者iptables。systemctlstopfirewalldsystemctldisablefirewalld防火墙配置如果开启防火墙,请开放21端口,被动模式下设置最大和最小端口范围,并在防火墙开放端口范围。修改vsftpd.conf文件,添加pasv_min_port=8022#最小端口pasv_max_port=8030 查看详情
vsftp配置使用(代码片段)
vsftp简介: VSFTP是一个基于GPL发布的类Unix系统上使用的FTP服务器软件,它的全称是VerySecureFTP从此名称可以看出来,编制者的初衷是代码的安全。 安全性是编写VSFTP的初衷,除了这与生俱来的安全特性以外,高速与高稳定... 查看详情
kvm虚机冷迁移(代码片段)
一实验环境原虚机名称:vm01-centos6.8原虚机所在宿主机:kvm-host-2迁移后虚机名称:vm01-cloud-centos6.8迁移后虚机所在宿主机:kvm-host-2二迁移过程2.1前期准备1[root@kvm-host~]#virshshutdownvm01-centos6.8 #关闭需要迁移的虚机2[root@kvm-host~]#virshli... 查看详情
mysql安装部署02-virtualbox虚拟机上centos6.8安装mysql5.1.73(代码片段)
...置,以便内外网均可访问4、安装前环境配置4.1、解决Centos6下yum无法使用的问题4.2、卸载系统自带MySQL4.3、系统配置:关闭selnux和防火墙5、安装6、总结1、环境准备VirtualBox版本:6.1MySQL版本:MySQL5.1.73操作系统版本&... 查看详情
vmware下centos6.8配置gfs文件系统
1.GFS介绍GFS简要说明,它有两种:1.Google文件系统:GFS是GOOGLE实现的是一个可扩展的分布式文件系统,用于大型的、分布式的、对大量数据进行访问的应用。它运行于廉价的普通硬件上,但可以提供容错功能。它可以给大量的用... 查看详情
vmware下centos6.8配置gfs文件系统
1.GFS介绍GFS简要说明,它有两种:1.Google文件系统:GFS是GOOGLE实现的是一个可扩展的分布式文件系统,用于大型的、分布式的、对大量数据进行访问的应用。它运行于廉价的普通硬件上,但可以提供容错功能。它可以给大量的用... 查看详情