Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

CentOS 安裝配置 FTP 服務 (vsftpd) 標準流程:yum 安裝、服務管理、配置檔調整、用戶建立、測試驗證

編輯:Linux 教學

1. 尋找與安裝套件

yum search vsftpd
sudo yum install vsftpd.x86_64

2. 服務狀態與啟用

sudo chkconfig --list | grep vsftpd
sudo chkconfig vsftpd on
sudo chkconfig --list | grep vsftpd  # 確認 2345 為 on
sudo /sbin/service vsftpd start

3. 核心配置 (/etc/vsftpd/vsftpd.conf)

# 關閉匿名登入
anonymous_enable=NO

# 本地用戶讀寫權限
local_enable=YES
write_enable=YES
local_umask=022

# 匿名用戶上傳下載 (如需開啟)
# anonymous_enable=YES
# anon_upload_enable=YES
# anon_mkdir_write_enable=YES
# anon_umask=022

4. 建立 FTP 用戶 (無登入 Shell)

sudo /usr/sbin/adduser -d /opt/ftp_user_home_dir -g ftp -s /sbin/nologin ftp_user
sudo passwd ftp_user

參數:-d 指定家目錄、-g ftp 加入 ftp 群組、-s /sbin/nologin 禁止系統登入。

5. 測試連線

ftp ftp_user@ftp_host
Copyright © Windows教程網 All Rights Reserved