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

解決 vsftpd 本地用戶無法登入認證問題

編輯:Linux 教學

問題現象

已搭建好 vsftpd 服務,但本地系統用戶無法通過 FTP 登入。

排查步驟與解決方案

1. 確認 vsftpd.conf 關鍵參數

編輯 /etc/vsftpd/vsftpd.conf(或 /etc/vsftpd.conf),確保啟用以下選項:

local_enable=YES
pam_service_name=vsftpd

2. 檢查 PAM 認證配置文件

/etc/pam.d/vsftpd 必須存在。若缺失,可從源碼包複製:

cp RedHat/vsftpd.pam /etc/pam.d/vsftpd

3. 驗證 vsftpd 是否連結 PAM 庫

執行以下命令查看動態庫依賴:

ldd /usr/local/sbin/vsftpd | grep pam

若輸出包含 libpam.so 則表示已正確連結 PAM。

常見補充說明

  • 確保防火牆開放 TCP 21 端口及被動模式端口範圍。
  • SELinux 環境下需設置 setsebool -P ftp_home_dir on 允許用戶訪問家目錄。
  • 檢查 /var/log/secure 或 /var/log/vsftpd.log 獲取詳細錯誤資訊。
Copyright © Windows教程網 All Rights Reserved