2009年9月6日 星期日

vsftpd:530 This FTP server is anonymous only.

今天實驗室server重開的時候 FTP忽然登不進去了,沒辦法使用一般帳號登入 只能用匿名帳號登入
錯誤訊息如下
530 This FTP server is anonymous only.
後來google了一下資料,要去修改/etc/vsftpd/vsftpd.conf
看到有說要增加

pam_service_name=vsftpd

或是

local_enable=YES

以我的情況,我是屬於後者 我查了vsftpd.conf
local_enable被設置成NO(有的人是被#註解調)
local_enable要設置了才能讓機器上的實體帳號才能登入

可是設置之後卻還是不能登入,server也restart過了
後來在找了一下資料,我的vsftpd是被xinetd啟動的,xinetd的設置檔是放在/etc之下
所以我把/etc/vsftpd/vsftpd.conf整份複製到/etc/vsftpd.conf就可以了
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd.conf

但是啟動後出現另一個錯誤訊息
500 OOPS: could not bind listening IPv4 socket
查了一下原因是因為port 21衝突,21 port被重複使用了

我之前用/etc/init.d/vsftpd去啟動了vsftpd,但是xinetd也啟動了vsftpd
關掉其中一個就好了,我是選擇關掉xinetd啟動那個
輸入

vi /etc/xinetd.d/vsftpd

修改xinetd的vsftpd設定


# default: on
# description:
# The vsftpd FTP server serves FTP connections. It uses
# normal, unencrypted usernames and passwords for authentication.
# vsftpd is designed to be secure.
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
# server_args =
# log_on_success += DURATION USERID
# log_on_failure += USERID
nice = 10
disable = yes
}


把disable設定成yes,之後輸入
/etc/init.d/xinetd restart
重新啟動服務就可以了

沒有留言: