ftp服务的搭建方法

  介绍

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

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

2。编辑主配置文件
# cd/etc/vsftpd/
# vi vsftpd。参看#添加如下项目
# # # # # # # # # # # # # # # # # #
anonymous_enable=没有
local_enable=是的
chroot_list_enable=
ascii_upload_enable=是的
ascii_download_enable=
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文件
触摸/etc/vsftpd/chroot_list

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

4。生成FTP用户密码数据库库文件
# db_load哈希- f - t - t/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=没有
anon_upload_enable=是的
anon_mkdir_write_enable=
anon_other_write_enable=YES
# # # # # # # # # # # # # # # # #

6。创建FTP用户
mkdir - p/FTP/ftptest
乔恩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 pam_userdb要求。所以db=/etc/vsftpd vusers
账户需要pam_userdb。所以db=/etc/vsftpd vusers

8。关闭防火墙
Linux7:
systemctl停止firewalld 
systemctl禁用firewalld

Linux6:
service iptables停止
chkconfig iptables了

9。第六关闭SELINUX
/etc/selinux/config
# SELINUX=执行,
SELINUX=disabled 

临时关闭:
setenforce 0,

10。启动vsftpd服务
Linux7
systemctl重启vsftpd
systemctl启用vsftpd

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

ftp服务的搭建方法