Bismillahirrohmanirrohim
Ini adalah isi file asli proftpd.conf bawaan slackware10
—————proftpd.conf—————————
# This is a basic ProFTPD configuration file.
# It establishes a single server and a single anonymous login.
# It assumes that you have a user/group “nobody” and “ftp”
# for normal/anonymous operation.
ServerName “ProFTPD Default Installation”
#ServerType standalone
ServerType inetd
DefaultServer on
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30
# Set the user and group that the server normally runs at.
User nobody
Group nogroup
# This next option is required for NIS or NIS+ to work properly:
#PersistentPasswd off
SystemLog /var/log/proftpd.log
TransferLog /var/log/xferlog
# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite on
</Directory>
# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from /etc/ftpusers.
<Anonymous ~ftp>
RequireValidShell off
User ftp
Group ftp
# We want clients to be able to login with “anonymous” as well as “ftp”
UserAlias anonymous ftp
# Limit the maximum number of anonymous logins
MaxClients 50
# We want ‘welcome.msg’ displayed at login, and ‘.message’ displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
# An upload directory that allows storing files but not retrieving
# or creating directories.
# <Directory incoming/*>
# <Limit READ>
# DenyAll
# </Limit>
#
# <Limit STOR>
# AllowAll
# </Limit>
# </Directory>
</Anonymous>
———————-eof proftpd.conf————————–
Konfigurasi diatas sebenarnya jika dijalankan sudah menjadi FTP server tetapi tidak aman. Tidak aman karena DefaultRoot nya tidak didefinisikan sehingga user dapat menjelajah kesystem.
Berikut adalah konfigurasi sederhana ftp agar DefaulRoot user hanya bisa mengakses folder /home/ :
————————-proftpd.conf————————–
ServerName “Sobey ProFTPD Server”
ServerType inetd
DefaultServer on
Port 21
Umask 022
MaxInstances 30
User suby
Group users
DefaultRoot /home/
SystemLog /var/log/proftpd.log
TransferLog /var/log/xferlog
<Directory /home>
AllowOverwrite on
</Directory>
MaxClients 50
DisplayLogin welcome.msg
DisplayFirstChdir .message
———————–eof proftpd.conf————————
Sebelum menjalankan FTP server kita perlu mengaktifkan servicenya di /etc/inetd.conf karena ServerType yang digunakan pada konfigurasi diatas menggunakan “inetd” bukan “standalone”.
Edit file /etc/inetd.conf:
root@Slackware10:~# pico /etc/inetd.conf
———————inetd.conf————————-
.
.
# These are standard services:
#
# File Transfer Protocol (FTP) server:
ftp stream tcp nowait root /usr/sbin/tcpd proftpd
#
.
.
.
———————eof inetd.conf———————-
Menjalankan service FTP server:
root@Slackware10:~# /usr/sbin/inetd
Mematikan service FTP server:
root@Slackware10:~# killall inetd
Check service FTP Server:
root@Slackware10:~# ps aux | grep inetd
root 1078 0.0 0.3 1380 528 ? Ss 15:52 0:00
Atau
root@Slackware10:~# nmap localhost
Starting nmap 3.50 ( http://www.insecure.org/nmap/ ) at 2007-11-22 15:40
WIT
Interesting ports on localhost (127.0.0.1):
(The 1653 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
37/tcp open time
113/tcp open auth
139/tcp open netbios-ssn
445/tcp open microsoft-ds
Nmap run completed — 1 IP address (1 host up) scanned in 0.724 seconds
Test FTP dari klien:
Buat user baru untuk ftp:
root@Slackware10:~# adduser suby
New password:123456
Re-enter new password:123456
Password changed
Coba lewat DOS:
C:Documents and SettingsIT-PRG>ftp 192.168.1.100
Connected to 192.168.1.100.
220 ProFTPD 1.2.9 Server (ProFTPD Default Installation) [Slackware10.sobey.net.id]
User (192.168.1.100:(none)): suby
331 Password required for suby.
Password:123456
230 User suby logged in.
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
sam.txt
Eny.jpg
proftpd.conf
226 Transfer complete.
ftp: 39 bytes received in 0,00Seconds 39000,00Kbytes/sec.
ftp>
Kalau lewat Internet Explorer pada address bar ketik ftp://192.168.1.100
Agar FTP dapat diakses mengunakan alamat domain tambahkan konfigurasi pada akhir /etc/inetd.conf sbb:
<VirtualHost sobey.net>
Port 2001
ServerAdmin suby@sobey.net
ServerName “Sobey FTP Server”
TrasferLog /var/spool/syslog/xfer/ftp.sobey.net
MaxLoginAttempts 3
RequireValidShell no
DefaultRoot /home/suby/
User suby
Group users
AllowOverWrite yes
<Directory /home/suby/>
<Limit ALL>
AllowUser suby
Allow .sobey.net
Allow 192.168.1.202
DenyAll
</Limit>
</Directory>
</VirtualHost>
Kalau lewat Internet Explorer pada address bar ketik ftp.sobey.net
Catatan server dns untuk sobey.net harus jalan