Rabu, 30 November 2011

Instalasi proftpd di CentOS

Proftpd adalah salah satu aplikasi utk transfer file menggunakan ftp (file transfer protocol). Salah satu kegunaan proftpd adalah utk download maupun upload file ke dalam web server ato server. Sebelum instalasi pastikan paket gcc sudah terinstal, untuk instalasinya seperti di bawah ini:

1. Pastikan paket gcc sudah ada, ini berguna utk install paket proftpd.
[root@localhost ~]# rpm -qa gcc*
gcc-gnat-4.1.2-42.el5
gcc-c++-4.1.2-42.el5
gcc-objc-4.1.2-42.el5
gcc-java-4.1.2-42.el5
gcc-4.1.2-42.el5
gcc-gfortran-4.1.2-42.el5
gcc-objc++-4.1.2-42.el5

2. Download proftpd.
[root@localhost downloads]# wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4rc3.tar.gz

3. Extract proftpd yg sudah di download.
[root@localhost downloads]# tar zxvf proftpd-1.3.2rc1.tar.gz
[root@localhost downloads]# cd proftpd-1.3.2rc1.tar.gz

4. Install proftpd
[root@localhost proftpd-1.3.2rc1]# ./configure
[root@localhost proftpd-1.3.2rc1]# make
[root@localhost proftpd-1.3.2rc1]# make install

5. Membuat user proftpd
[root@localhost proftpd-1.3.2rc1]# useradd proftpd -s /dev/null

6. Membuat direktori utk ftp
[root@localhost proftpd-1.3.2rc1]# mkdir /home/ftp

7. Edit beberapa baris utk setting proftpd.
[root@localhost proftpd-1.3.2rc1]# nano /usr/local/etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# ‘proftpd.conf’ for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# “nobody” and “ftp” for normal operation and anon.
ServerName                      “ProFTPD centos”
ServerType                      standalone
DefaultServer                   on
# Port 21 is the standard FTP port.
Port                            21
# Don’t use IPv6 support by default.
# UseIPv6                               off
# 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 under which the server will run.
User                            proftpd
Group                           proftpd

# To cause every FTP user to be “jailed” (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~
# Normally, we want files to be overwriteable.
AllowOverwrite          on
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous /home/ftp>
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                    10
# We want ‘welcome.msg’ displayed at login, and ‘.message’ displayed
# in each newly chdired directory.
DisplayLogin                  welcome.msg
DisplayChdir                  .message
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>

8.  Jalankan service proftpd.
[root@localhost proftpd-1.3.2rc1]# /usr/local/sbin/proftpd

9. Apakah service sudah berjalan dapat menjalankan perintah ini:
[root@localhost proftpd-1.3.2rc1]# ps aux | grep proftpd
proftpd   2188  0.0  0.4   2716  1096 ?        Ss   21:56   0:00 proftpd:
(accepting connections)

10. Setelah semua berhasil dengan baik kita akan coba login ke dalam ftp server menggunakan user=rivkhi dgn password=rivkhi dan user anonymous tanpa password.
User rivkhi
[root@localhost proftpd-1.3.2rc1]# ftp localhost
Connected to localhost.localdomain.
220 ProFTPD 1.3.2rc1 Server (ProFTPD centos) [127.0.0.1]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): rivkhi
331 Password required for rivkhi
Password:
230 User rhesa logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 “/home/rivkhi” is the current directory
ftp> ls
227 Entering Passive Mode (127,0,0,1,198,73).
150 Opening ASCII mode data connection for file list
drwxr-xr-x   2 rivkhi    rivkhi        4096 Oct 13 19:18 Desktop
drwxrwxr-x   7 rivkhi    rivkhi        4096 Oct 21 13:23 rpm
226 Transfer complete
ftp> quit
221 Goodbye.
User anonymous
[root@localhost proftpd-1.3.2rc1]# ftp localhost
Connected to localhost.localdomain.
220 ProFTPD 1.3.2rc1 Server (ProFTPD centos) [127.0.0.1]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): anonymous
331 Anonymous login ok, send your complete email address as your password
Password:
230 Anonymous access granted, restrictions apply
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 “/” is the current directory
ftp> ls
227 Entering Passive Mode (127,0,0,1,210,74).
150 Opening ASCII mode data connection for file list
226 Transfer complete
ftp> quit
221 Goodbye.

Tidak ada komentar:

Posting Komentar