Bạn đã tạo user và pass cho tài khoản FTP nhưng không đăng nhập được. Để khắc phục lỗi này, bạn có thể làm theo hướng dẫn sau:
1. SSH vào VPS và vào thư mục root
cd /root
2. Dùng lệnh nano để tạo file fix-ftp.sh
nano file-fpt.sh
3. Copy nội dung bên dưới và paste vào file fix-ftp.sh
#!/bin/sh PF=/etc/proftpd.passwd cd /usr/local/directadmin/data/users for u in `ls`; do { if [ ! -d $u ]; then continue; fi SHADOW=/home/$u/.shadow if [ ! -e $SHADOW ]; then continue; fi #make sure it doesn't already exist COUNT=`grep -c -e "^${u}:" $PF` if [ "$COUNT" -ne 0 ]; then continue; fi UUID=`id -u $u` UGID=`id -g $u` echo "${u}:`cat /home/$u/.shadow`:${UUID}:${UGID}:system:/home/${u}:/bin/false"; }; done;
4. Lưu lại file sau đó chmod cho file fix-ftp.sh
chmod +x fix_ftp.sh
5. Chạy lệnh
./fix_ftp.sh >> /etc/proftpd.passwd
making sure to use 2 > characters (>>) and not just 1, as using just 1 would delete whatever was previously there (which is a bad thing if there are any ftp@domain.com accounts).
Chú ý
Hãy chắc chắn rằng bạn đã set đúng quyền cho file /etc/proftpd.passwd
là root:ftp:
Nếu chưa phân quyền cho file proftpd.passwd bạn có thể làm theo cách sau:
chown root:ftp /etc/proftpd.passwd
chmod 640 /etc/proftpd.passwd