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

Ubuntu vsftpd 530 登入失敗:PAM 模組衝突解決方案

編輯:關於伺服器

錯誤現象

vsftpd 啟動正常,但 FTP 用戶登入提示 530 Login incorrect,日誌無明顯錯誤。匿名登入可能正常,本地用戶均失敗。

vsftpd 530 錯誤截圖

根本原因

Ubuntu 預設啟用 PAM 認證,vsftpd 依賴 /etc/pam.d/vsftpd 進行驗證。若該檔案配置錯誤或缺失必要模組 (如 pam_unix.so),本地用戶無法通過認證。源碼編譯安裝的 vsftpd 不會自動產生此檔,導致衝突。

快速修復:移除 PAM 配置檔

sudo apt-get remove vsftpd
sudo rm /etc/pam.d/vsftpd
sudo apt-get install vsftpd

重新安裝會生成預設正確的 PAM 配置,本地用戶即可登入。

替代方案:檢查並修正 PAM 檔案

編輯 /etc/pam.d/vsftpd,確保包含:

auth required pam_unix.so
account required pam_unix.so

並確認 vsftpd.conf 中:

pam_service_name=vsftpd
local_enable=YES
write_enable=YES

驗證

service vsftpd restart
# 使用 FTP 客戶端測試本地用戶登入
Copyright © Windows教程網 All Rights Reserved