centos配置vsftp,ftp服務

一、安裝vsftplinux

1.一、安裝vsftp,測試安裝的vsftpd的版本是:vsftpd.x86_64 0:3.0.2-11.el7_2服務器

yum -y install vsftpd

1.二、修改配置文件測試

vi /etc/vsftpd/vsftpd.conf

    保證下面3項爲YES3d

    anonymous_enable=YEScode

    anon_upload_enable=YESblog

    anon_mkdir_write_enable=YESci

1.三、設置vsftpd開機啓動it

systemctl enable vsftpd.service

1.四、啓動並查看vsftpd服務狀態,systemctl啓動服務成功不會有任何提示,綠色的active表示服務正在運行class

systemctl start vsftpd.service
systemctl status vsftpd.service

 

二、本地驗證ftp是否能夠正常訪問百度

2.一、安裝ftp

yum -y install ftp

2.二、使用anonymous登錄,無需密碼

ftp localhost

220表示服務正常,能夠登錄;230表示登錄成功。

2.三、查看FTP服務器文件夾信息

 

三、  外部證ftp是否能夠正常訪問

3.一、關閉防火牆(也能夠設置防火牆規則,得再百度了)

systemctl stop firewalld.service

  爲防止機器重啓後防火牆服務從新開啓,可將防火牆服務永久關閉。

systemctl disable firewalld.service

3.二、在window上輸入ftp://IP地址,可看到ftp下的目錄(pub爲系統預設的)

四、文件讀寫。

     到上面爲止,咱們發現ftp目錄下並不能讀寫文件,這是由文件夾權限和selinux引發的。

4.一、設置文件夾權限,將pub文件夾的權限設置爲777

chmod 777 -R /var/ftp/pub

4.一、關閉selinux服務

vi /etc/selinux/config

    將SELINUX=enforcing改成:SELINUX=disabled

4.三、系統重啓,讓配置生效

shutdown -r now

4.四、上傳文件

相關文章
相關標籤/搜索