Tuesday, June 16, 2009

Cài đặt ProFTPD server (secure way)

1.Mở SSH console, gõ lệnh:

apt-get install proftpd

2.Bổ sung dòng sau vào file /etc/shells

/bin/false

3.Tạo /FTP-shared directory

cd /
mkdir /FTP-shared

4.Create a user named userftp which will be used only for ftp access. This user don't need a valid shell (more secure) therefore select /bin/false shell for userftp and /home/FTP-shared as home directory (property button in user and group window) :

useradd nguoiquynhon -d /FTP-shared -s /bin/false
passwd nguoiquynhon

5.Tạo các thư mục upload / download
cd /FTP-shared/
mkdir download
mkdir upload

cd /FTP-shared
chmod 755 download
chmod 777 upload

6.Sửa file /etc/proftpd/proftpd.conf với nội dung tương tự sau
cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf.org
vi /etc/proftpd/proftpd.conf

RootLogin on

Umask 022 022
AllowOverwrite off

DenyAll




Umask 022 022
AllowOverwrite off

DenyAll



/FTP-shared/upload/>
Umask 022 022
AllowOverwrite on

DenyAll



AllowAll



7.Khởi động lại FTP Server
/etc/init.d/proftpd start
/etc/init.d/proftpd stop
/etc/init.d/proftpd restart

8.Cho phép root login: sửa file /etc/ftpusers, lọai bỏ root và bổ sung vào file /etc/proftpd/proftpd.conf dòng:
RootLogin on

No comments:

Post a Comment