天天看點

基于ECS搭建FTP服務筆記基于ECS搭建FTP服務筆記

基于ECS搭建FTP服務筆記

連接配接ECS伺服器

windows平台下

1. 使用cmd或PowerShell指令行輸入工具。
2. ssh -V指令檢查是否已經安裝OpenSSH工具。
3. 連接配接伺服器: ssh [email protected] 回車輸入密碼即可登入。            

安裝vsftpd

安裝vsftpd,指令:yum install -y vsftpd

[root@iZuf67gjh27h6cqb2mphnwZ ~]# yum install -y vsftpd
Loaded plugins: fastestmirror
Determining fastest mirrors
base                             | 3.6 kB     00:00
epel                             | 4.7 kB     00:00
extras                           | 2.9 kB     00:00
updates                          | 2.9 kB     00:00
(1/7): epel/x86_64/group_gz        |  95 kB   00:00
(2/7): base/7/x86_64/group_gz      | 153 kB   00:00
(3/7): extras/7/x86_64/primary_db  | 206 kB   00:00
(4/7): epel/x86_64/updateinfo      | 1.0 MB   00:00
(5/7): updates/7/x86_64/primary_db | 4.5 MB   00:00
(6/7): base/7/x86_64/primary_db    | 6.1 MB   00:00
(7/7): epel/x86_64/primary_db      | 6.9 MB   00:00
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-27.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================
 Package    Arch       Version           Repository
                                                   Size
========================================================
Installing:
 vsftpd     x86_64     3.0.2-27.el7      base     172 k

Transaction Summary
========================================================
Install  1 Package

Total download size: 172 k
Installed size: 353 k
Downloading packages:
vsftpd-3.0.2-27.el7.x86_64.rpm     | 172 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : vsftpd-3.0.2-27.el7.x86_64           1/1
  Verifying  : vsftpd-3.0.2-27.el7.x86_64           1/1

Installed:
  vsftpd.x86_64 0:3.0.2-27.el7

Complete!           

設定FTP服務開機自啟動,指令:systemctl enable vsftpd.service

[root@iZuf67gjh27h6cqb2mphnwZ ~]# systemctl enable vsftpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.           

啟動FTP服務,指令:systemctl start vsftpd.service

檢視FTP服務監聽的端口,指令:netstat -antup | grep ftp

[root@iZuf67gjh27h6cqb2mphnwZ ~]# netstat -antup | grep ftp
tcp6       0      0 :::21                   :::*                    LISTEN      1453/vsftpd
#其中21即為監聽的端口号           

匿名使用者模式下配置vsftpd

1.修改配置檔案vsftpd.conf

vim /etc/vsftpd/vsftpd.conf
将檔案中anon_upload_enable=YES前面的#号删去           

2.更改/var/ftp/pub目錄的權限,為FTP使用者添加寫權限

chmod o+w /var/ftp/pub/           

3.重新開機FTP服務

systemctl restart vsftpd.service