ftp服务的搭建方法-创新互联

本篇内容主要讲解“ftp服务的搭建方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“ftp服务的搭建方法”吧!

创新互联建站长期为超过千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为连山企业提供专业的网站设计制作、网站制作,连山网站改版等技术服务。拥有十余年丰富建站经验和众多成功案例,为您定制开发。

1.rpm包安装
# yum install -y ftp
# yum install -y vsftpd
# yum install db4 db4-utils (Linux6)
# yum install -y libdb-utils (Linux7)

2.编辑主配置文件
# cd /etc/vsftpd/
# vi vsftpd.conf #添加如下项目
##################
anonymous_enable=NO
local_enable=YES
chroot_list_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
pam_service_name=vsftpd
guest_enable=YES
guest_username=ftp
user_config_dir=/etc/vsftpd/vconf

pasv_enable=YES
pasv_min_port=40000
pasv_max_port=40080
pasv_promiscuous=YES
allow_writeable_chroot=YES(Linux7)
#########################
创建chroot_list文件
touch /etc/vsftpd/chroot_list

3.编辑FTP用户密码文件  (每次添加FTP用户3,4,5,6,10步骤都要做)
# mkdir vconf
# vi vusers
############FTP用户密码文件,一行用户名一行密码,类似如下:
ftptest      
ftptest
############

4.生成FTP用户密码db库文件
# db_load -T -t hash -f /etc/vsftpd/vusers /etc/vsftpd/vusers.db

5.配置FTP用户个人配置文件
cd vconf
vi ftptest(必须同上面密码文件的用户名)
###############
local_root=/FTP/ftptest(ftp用户的根目录)
write_enable=YES
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
#################

6.创建FTP用户
mkdir -p /FTP/ftptest
chown ftptest.ftptest /FTP/ftptest
chmod 777 /FTP/ftptest

useradd -d /FTP/ftptest -s /sbin/nologin ftptest
passwd ftptest

7.vi /etc/pam.d/vsftpd添加如下行:
auth required pam_userdb.so db=/etc/vsftpd/vusers
account required pam_userdb.so db=/etc/vsftpd/vusers

8.关闭防火墙
Linux7:
systemctl stop firewalld 
systemctl disable firewalld

Linux6:
service iptables stop
chkconfig iptables off

9.关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing  
SELINUX=disabled 

临时关闭:
setenforce 0 

10.启动vsftpd服务
Linux7
systemctl restart vsftpd
systemctl enable vsftpd

Linux6
service vsftpd restart
chkconfig vsftpd on

到此,相信大家对“ftp服务的搭建方法”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


网站题目:ftp服务的搭建方法-创新互联
本文网址:http://myzitong.com/article/dccohs.html