Home > Informatika, Linux, Networking > Konfigurasi FTP Server di Ubuntu 7.10

Konfigurasi FTP Server di Ubuntu 7.10

December 8th, 2008 Leave a comment Go to comments

FTP (singkatan dari File Transfer Protocol) adalah sebuah protokol Internet yang berjalan di dalam lapisan aplikasi yang merupakan standar untuk pentransferan berkas (file) komputer antar mesin-mesin dalam sebuah internetwork.

FTP merupakan salah satu protokol Internet yang paling awal dikembangkan, dan masih digunakan hingga saat ini untuk melakukan pengunduhan (download) dan penggugahan (upload) berkas-berkas komputer antara klien FTP dan server FTP. Sebuah Klien FTP merupakan aplikasi yang dapat mengeluarkan perintah-perintah FTP ke sebuah server FTP, sementara server FTP adalah sebuah Windows Service atau daemon yang berjalan di atas sebuah komputer yang merespons perintah-perintah dari sebuah klien FTP. Perintah-perintah FTP dapat digunakan untuk mengubah direktori, mengubah modus transfer antara biner dan ASCII, menggugah berkas komputer ke server FTP, serta mengunduh berkas dari server FTP.

Sebuah server FTP diakses dengan menggunakan Universal Resource Identifier (URI) dengan menggunakan format ftp://namaserver. Klien FTP dapat menghubungi server FTP dengan membuka URI tersebut.
(Sumber : http://id.wikipedia.org/wiki/FTP)

Langkah-langkah konfigurasi FTP Server (proftpd) di Ubuntu Gutsy Gibbon :
1. Download dan install program proftpd untuk FTP Server.

#apt-get install proftpd
Reading package lists… Done
Building dependency tree
Reading state information… Done
Suggested packages:
proftpd-doc
The following NEW packages will be installed:
proftpd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 784kB of archives.
After unpacking 2331kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com feisty/universe proftpd 1.3.0-21ubuntu1 [784kB]
Fetched 784kB in 14s (54.1kB/s)
Preconfiguring packages …
Selecting previously deselected package proftpd.
(Reading database … 155004 files and directories currently installed.)
Unpacking proftpd (from …/proftpd_1.3.0-21ubuntu1_i386.deb) …
Setting up proftpd (1.3.0-21ubuntu1) …
——— IMPORTANT INFORMATION FOR XINETD USERS ———-
The following line will be added to your /etc/inetd.conf file:
ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/proftpd
If you are indeed using xinetd, you will have to convert the
above into /etc/xinetd.conf format, and add it manually. See
/usr/share/doc/xinetd/README.Debian for more information.
———————————————————–
Adding system user `proftpd’ (UID 118) …
Adding new user `proftpd’ (UID 118) with group `nogroup’ …
Not creating home directory `/var/run/proftpd’.
Adding system user `ftp’ (UID 119) …
Adding new user `ftp’ (UID 119) with group `nogroup’ …
Creating home directory `/home/ftp’ …
`/usr/share/proftpd/templates/welcome.msg’ -> `/home/ftp/welcome.msg.proftpd-new’
ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.

Coba jalankan proftpd.

#/etc/init.d/proftpd start
Password:
ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.

2. Jika tidak ada repositori lokal, maka bisa dilakukan secara manual yaitu dengan menginstall file-file dependensi yang dibutuhkan. Install program proftpd (proftpd_1.3.0-24ubuntu1_i386.deb).

root@komputer02-desktop:/# dpkg -i proftpd_1.3.0-24ubuntu1_i386.deb 
(Reading database ... 89245 files and directories currently installed.)
Preparing to replace proftpd 1.3.0-24ubuntu1 (using proftpd_1.3.0-24ubuntu1_i386.deb) ...
Unpacking replacement proftpd ...
dpkg: dependency problems prevent configuration of proftpd:
 proftpd depends on libmysqlclient15off (>= 5.0.27-1); however:
  Package libmysqlclient15off is not installed.
 proftpd depends on libpq5; however:
  Package libpq5 is not installed.
dpkg: error processing proftpd (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 proftpd

Dari pesan di atas bisa dilihat bahwa instalasi proftpd masih membutuhkan file dependensi: libmysqlclient15off dan libpq5.
Install dulu file dependensi dengan menggunakan perintah: dpkg -i namafile.deb
Jika sudah, coba install lagi proftpd (proftpd_1.3.0-24ubuntu1_i386.deb)

root@komputer02-desktop:/# dpkg -i libmysqlclient15off_5.0.45-1ubuntu3.4_i386.deb 
(Reading database ... 89098 files and directories currently installed.)
Preparing to replace libmysqlclient15off 5.0.45-1ubuntu3.4 (using libmysqlclient15off_5.0.45-1ubuntu3.4_i386.deb) ...
Unpacking replacement libmysqlclient15off ...
Setting up libmysqlclient15off (5.0.45-1ubuntu3.4) ...

Processing triggers for libc6 ...
ldconfig deferred processing now taking place

Begitu juga dengan file libpq5 dilanjutkan dengan install proftpd.

root@komputer02-desktop:/# dpkg -i proftpd_1.3.0-24ubuntu1_i386.deb 
(Reading database ... 89098 files and directories currently installed.)
Preparing to replace proftpd 1.3.0-24ubuntu1 (using proftpd_1.3.0-24ubuntu1_i386.deb) ...
Unpacking replacement proftpd ...
Setting up proftpd (1.3.0-24ubuntu1) ...
Adding system user `proftpd' (UID 109) ...
Adding new user `proftpd' (UID 109) with group `nogroup' ...
Not creating home directory `/var/run/proftpd'.
Adding system user `ftp' (UID 110) ...
Adding new user `ftp' (UID 110) with group `nogroup' ...
Creating home directory `/home/ftp' ...
`/usr/share/proftpd/templates/welcome.msg' -> `/home/ftp/welcome.msg.proftpd-new'
 * Starting ftp server proftpd - IPv6 getaddrinfo 'komputer02-desktop' 
 error: No address associated with hostname 				  [ OK ]
 

3. Pilih standalone.
standalone

4. Membuat direktori

root@komputer02-desktop:/home# mkdir ftp_shared
root@komputer02-desktop:/home# cd ftp_shared/; mkdir upload download
Set security permission
root@komputer02-desktop:/home/ftp_shared# cd ..
root@komputer02-desktop:/home# sudo chmod 755 ftp_shared/ 
root@komputer02-desktop:/home# cd ftp_shared/ 
root@komputer02-desktop:/home/ftp_shared# sudo chmod 755 download/
root@komputer02-desktop:/home/ftp_shared# sudo chmod 777 upload/

5. Membuat user baru untuk FTP
Melalui menu System > Administration > Users and Groups kemudian klik Add user.
misalkan kita menambah user: wiwin, dengan folder homenya: /home/ftp_shared
adduser adduser

6. Mengkonfigurasi proftpd server
Langkah akhir adalah mengkonfigurasikan proftpd. File konfigurasi proftpd berada di /etc/proftpd/proftpd.conf.
Sebelumnya backup dulu file proftpd.conf dan selanjutnya edit file tersebut.

root@komputer02-desktop:/etc/proftpd# cp proftpd.conf proftpd.conf.asli
root@komputer02-desktop:/etc/proftpd# pico proftpd.conf
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
# 

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6				off

ServerName			"Debian"
ServerType			standalone
DeferWelcome			off

MultilineRFC2228		on
DefaultServer			on
ShowSymlinks			on

TimeoutNoTransfer		600
TimeoutStalled			600
TimeoutIdle			1200

DisplayLogin                    welcome.msg
DisplayFirstChdir               .message
ListOptions                	"-l"

DenyFilter			\*.*/

# Use this to jail all users in their homes 
# DefaultRoot			~

# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
# RequireValidShell		off

# Port 21 is the standard FTP port.
Port				2008

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts                  49152 65534

# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress		1.2.3.4

# 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				wiwin
Group				nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask				022  022
# Normally, we want files to be overwriteable.
AllowOverwrite			on

# Uncomment this if you are using NIS or LDAP to retrieve passwords:
# PersistentPasswd		off

# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile			off

# Choose a SQL backend among MySQL or PostgreSQL.
# Both modules are loaded in default configuration, so you have to specify the backend 
# or comment out the unused module in /etc/proftpd/modules.conf.
# Use 'mysql' or 'postgres' as possible values.
#
#
# SQLBackend			mysql
#

TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

<IfModule mod_tls.c>
TLSEngine off
</IfModule>

<IfModule mod_quota.c>
QuotaEngine on
</IfModule>

<IfModule mod_ratio.c>
Ratios on
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default. 
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        on
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine on
</IfModule>

# A basic anonymous configuration, no upload directories.

# 
#   User				ftp
#   Group				nogroup
#   # We want clients to be able to login with "anonymous" as well as "ftp"
#   UserAlias			anonymous ftp
#   # Cosmetic changes, all files belongs to ftp user
#   DirFakeUser	on ftp
#   DirFakeGroup on ftp
# 
#   RequireValidShell		off
# 
#   # Limit the maximum number of anonymous logins
#   MaxClients			10
# 
#   # 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
#   
#     
#       DenyAll
#     
#   

<Directory /home/ftp_shared> 
Umask 022 022 
AllowOverwrite off 
<Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD> 
DenyAll 
</Limit> 
</Directory>
 
<Directory /home/ftp_shared/download/*> 
Umask 022 022 
AllowOverwrite off 
<Limit MKD STOR DELE XMKD RNEF RNTO RMD XRMD> 
DenyAll 
</Limit> 
</Directory> 

<Directory /home/ftp_shared/upload/> 
Umask 022 022 
AllowOverwrite on 
<Limit READ RMD DELE> 
DenyAll 
</Limit> 
</Directory> 

#   # Uncomment this if you're brave.
#   # 
#   #   # Umask 022 is a good standard umask to prevent new files and dirs
#   #   # (second parm) from being group and world writable.
#   #   Umask				022  022
#   #            
#   #            DenyAll
#   #            
#   #            
#   #            AllowAll
#   #            
#   # 
# 
# 

7. Restart service proftpd

root@komputer02-desktop:/# /etc/init.d/proftpd restart
 * Stopping ftp server proftpd                                            [ OK ] 
 * Starting ftp server proftpd                                            [ OK ] 

8. Sampai di sini, konfigurasi proftpd selesai. Sekarang bisa dicoba upload file dari komputer lain ke komputer yang sudah kita setting sebelumnya. Untuk melakukan transfer file (upload, download) di windows bisa menggunakan program FileZilla atau program FTP lain.
Host – > masukkan hostname/IP komp tujuan (exp. 192.168.1.2)
Username – > masukkan username yang telah dibuat sebelumnya (wiwin)
Password – > Masukkan password dari username
Port – > Masukkan portnya (2008)
Untuk lebih jelasnya bisa dilihat gambar berikut.
filezilla

9. Untuk melakukan upload dan download dari atau ke komputer tujuan bisa dilakukan dengan drag dan drop.
upload

  1. December 8th, 2008 at 14:21 | #1
    Using Konqueror Konqueror 3.5 on Debian GNU/Linux Debian GNU/Linux

    Mas Dosen, ini materi kuliah ato….. he he he, BTW…. Mas Dosen sedang sakau Debian ya?

  2. December 11th, 2008 at 08:30 | #2
    Using Opera Opera 9.22 on Windows Windows XP

    Ini cuma dokumentasi aja. ben ra lali getoo… Weks, kepikiran Debi je. Ngopi Debi ne lah. Rep tak gajale.

  3. December 11th, 2008 at 19:12 | #3
    Using Debian IceWeasel Debian IceWeasel 2.0.0.12 on Linux Linux

    Aku ora nganggo Debian kok, tenan. Yen ora percoyo ulatno duwur kuwi….. using….. on …… 😀

  4. January 6th, 2009 at 17:35 | #4
    Using Mozilla Firefox Mozilla Firefox 3.0.5 on Windows Windows XP

    Ada kata bijak, “ikatlah ilmu dengan menulisnya”, itu kata imam Ali. OK mas semangat terus nulisnya. Jangan lupa u juga komment ke blogQ ya 😀

  5. January 6th, 2009 at 20:48 | #5
    Using Mozilla Firefox Mozilla Firefox 3.0 on Windows Windows XP

    @e12
    euheehue… iya, makasih. Ok, inysaAllah. ^_^

  6. June 12th, 2009 at 10:27 | #6
    Using Mozilla Mozilla 2.0a1pre on Windows Windows XP

    great…

  1. No trackbacks yet.

*

Bad Behavior has blocked 1094 access attempts in the last 7 days.