Không đăng nhập được FTP sau khi đổi password từ DirectAdmin

1. Lỗi gì dây?

Hôm nay sau khi vào DirectAdmin (DA) đổi password FTP xong thì không connect vào FTP được nữa, thử dùng lại password cũ thì vào được.

Sau một lúc tìm hiểu thì thấy rằng trên server đang chạy pure-ftpd service, và có cả proftpd nhưng service này đang stop.

Thử stop pure-ftpd service:

/etc/init.d/pure-ftpd stop

Sau đó start proftpd service:

service proftpd start

Mọi thứ trở nên ok, new FTP password hoạt động.

Disable pure-ftpd service và enable proftpd service:

chkconfig pure-ftpd off
chkconfig proftpd on

Kiểm tra danh sách service

chkconfig --list

2. Tìm hiểu nguyên nhân

Trước đây pure-ftpd vẫn hoạt động ổn (bằng chứng là pass cũ dùng được). Vì sao bây giờ password FTP pure-ftpd không thay đổi được từ DA? 

Sau một vài tìm kiếm mình có các nội dung sau:

Từ trang: https://www.directadmin.com/features.php?id=1143

Added support for Pure-FTPD.

The unified_ftp_password_file option must be set to 1 and all passwords converted:
http://www.directadmin.com/features.php?id=1134

pureftp=1

should also be set to 1.

After any change to the /etc/proftpd.passwd file, DA will add a task.queue entry:

action=rewrite&value=pureftp_db

and the dataskq will call:

/usr/bin/pure-pw mkdb /etc/pureftpd.pdb -f /etc/proftpd.passwd

Installation:
Use custombuild to install this for you:

cd /usr/local/directadmin/custombuild
./build set proftpd no
./build set pureftpd yes
./build pureftpd

Và một nội dung khác từ trang: https://help.directadmin.com/item.php?id=107

1) check for /usr/local/directadmin/data/task.queue
It should be deleted every minute. If it exists, check it's contents. If there are more than just 1 or 2 lines, then the dataskq is not running.
2) check /var/log/cron (/var/log/syslog on Debian). See if the dataskq is running every minute (logged every minute). If not, try running

chmod 644 /etc/cron.d/directadmin_cron
/sbin/service crond restart

3) make sure crond is running ("cron" on FreeBSD):

ps ax | grep cron

4) try restarting cron: /sbin/service crond restart. Check /var/log/cron and /var/log/messages for possible problems with the /etc/cron.d/directadmin_cron file (/etc/crontab on FreeBSD).
If you dont have crond (rpm based systems) type:

yum -y install vixie-cron cronie
service crond start
chkconfig crond on

5) If all of the above checkout but the task.queue is still not being processed, try running it manually:

/usr/local/directadmin/dataskq d

3. Kiểm tra & xử lý

Mở file tại

/usr/local/directadmin/data/task.queue

Thì thấy còn rất nhiều task chưa thực thi. Như vậy là trước đây đã cài đặt và cấu hình dùng pure-ftpd, nhưng vì lý do gì đó task.queue không hoạt động. Theo hướng dẫn mình thực thi các command sau:

chmod 644 /etc/cron.d/directadmin_cron
/sbin/service crond restart
ps ax | grep cron
service crond start 
chkconfig crond on
/usr/local/directadmin/dataskq d
service proftpd stop
/etc/init.d/pure-ftpd start

Kiểm tra kết nối FTP với password mới thì hoạt đông tốt, vì vậy mình cấu hình service lại như cũ rồi reboot server

chkconfig pure-ftpd on
chkconfig proftpd off

 

Mr.Phan

KTS, KSXD, Developer

You may also like...

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *