linux中Pure-FTPd出現“登入失敗: 530 Login authentication failed”

來源:互聯網
上載者:User


再次遭遇Pure-FTPd“登入失敗: 530 Login authentication failed”的問題,這一次的原因竟然是虛擬使用者uid小於pure-ftpd.conf中的MinUID值,現在詳細說明整個查錯過程。

一般情況下,我是使用yum來安裝pure-ftpd,並直接使用PureDB來驗證使用者的登入,一切是為了方便快捷。這一次也一樣,安裝完後,添加虛擬使用者,綁定到目錄/data/www,但這次給予虛擬使用者指定的使用者和組是apache,其uid和gid是48:

apache:x:48:48:Apache:/data/www:/sbin/nologin
nginx:x:498:498:nginx user:/data/cache/nginx:/sbin/nologin

使用lftp登入,及提示出錯資訊:

lftp admin@192.168.1.168:~> ls
---- 正在串連到 192.168.1.168 (192.168.1.168) 連接埠 21
<--- 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
<--- 220-You are user number 1 of 50 allowed.
<--- 220-Local time is now 08:51. Server port: 21.
<--- 220-This is a private system - No anonymous login
<--- 220 You will be disconnected after 15 minutes of inactivity.
---> FEAT
<--- 211-Extensions supported:  
<---  EPRT
<---  IDLE
<---  MDTM
<---  SIZE
<---  REST STREAM
<---  MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
<---  MLSD
<---  AUTH TLS
<---  PBSZ
<---  PROT
<---  UTF8
<---  ESTA
<---  PASV
<---  EPSV
<---  SPSV
<---  ESTP
<--- 211 End.
---> AUTH TLS
<--- 500 This security scheme is not implemented
---> OPTS UTF8 ON
<--- 200 OK, UTF-8 enabled  
---> OPTS MLST type;size;modify;UNIX.mode;UNIX.uid;UNIX.gid;
<--- 200  MLST OPTS type;size;sizd;modify;UNIX.mode;UNIX.uid;UNIX.gid;unique;
---> USER admin
<--- 331 User admin OK. Password required
---> PASS XXXX
<--- 530 Login authentication failed
---> PWD
ls: 登入失敗: 530 Login authentication failed
<--- 530 You aren't logged in
---> QUIT
<--- 221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
<--- 221 Logout.
---- 關閉控制串連

而在/var/log/messages中找到的錯誤資訊:

Feb 28 08:46:32 test pure-ftpd: (?@192.168.1.10) [INFO] New connection from 192.168.1.10
Feb 28 08:46:34 test pure-ftpd: (?@192.168.1.10) [WARNING] Can't login as [admin]: account disabled
Feb 28 08:46:38 test pure-ftpd: (?@192.168.1.10) [INFO] Logout.
Feb 28 08:46:50 test pure-ftpd: (?@192.168.1.10) [INFO] New connection from 192.168.1.10
Feb 28 08:46:51 test pure-ftpd: (?@192.168.1.10) [WARNING] Can't login as [admin]: account disabled
Feb 28 08:46:53 test pure-ftpd: (?@192.168.1.10) [INFO] Logout.

一直在想,怎麼會出現account disabled的呢,自己都沒有做過禁用帳戶的動作,惟有一行行地查看pure-ftpd.conf的配置內容,當查看到MinUID這行時,突然醒悟過來,請看:

# Minimum UID for an authenticated user to log in.
MinUID                     500

一切都明白了,pure-ftpd配置中只允許uid大於等於500的,才可以登入ftp,因此,解決方案有:
1. 將設定檔的MinUID設定成48,儲存重啟pure-ftpd
2. 建立新ftp使用者,uid大於500的,重新分配虛擬使用者uid和gid

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.