Bạn đã tạo đúng user password FTP nhưng không thể đăng nhập được, bạn có thể làm theo hướng dẫn sau của hostingviet.vn để thêm lại các tài khoản FTP của hệ thống vào trong file /etc/proftpd.passwd.
1.Các bạn SSH và 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. Sao chép nội dung bên dưới 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. Sau đó 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 đã sẽ đú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 dưới đây
chown root:ftp /etc/proftpd.passwd chmod 640 /etc/proftpd.passwd
