Kamis, 02 Februari 2012

Konfigurasi FTP SERVER pada centOS

Konfigurasi FTP SERVER pada centOS

suatu saya sedang PKL saya di suruh mengkonfigurasi FTP SERVER di centOS. awalnya saya bingung karena saya belum pernah mengkonfigurasi FTP SERVER dan saya juga belum bisa menggunakan centOS tanpa GUI (tanpa grafik).
kemudian saya browsing di internet untuk mencari caranya. Nah akhirnya saya mendapatkan tutorialnya tetapi saya masih bingung karena saya belum mengetahui perintah-perintah dasar pada centOS. Tetapi saya terus mencoba sampai BERHASIL.
Langsung aja kita ke pokok materinya niih...
  1. Pastikan paket vsftpd telah terinstall dalam komputer anda, atau ketikan (harus terkoneksi internet)
  2. [root@ardysmart]# yum install vsftpd
  3. Kemudian konfigurasikan file
  4. [root@ardysmart]#/etc/vsftp/vsftpd.conf
  5. kemudian edit potongan konfigurasi menjadi seperti ini.
  6. # Example config file /etc/vsftpd/vsftpd.conf
       #
       # The default compiled in settings are fairly paranoid.
        This sample file
       # loosens things up a bit, to make the ftp daemon more
        usable.
       # Please see vsftpd.conf.5 for all compiled in defaults.
       #
       # READ THIS: This example file is NOT an exhaustive list  
        of vsftpd options.
       # Please read the vsftpd.conf.5 manual page to get a full
        idea of vsftpd’s
       # capabilities.
       #
       # Allow anonymous FTP? (Beware – allowed by default if you
        comment this out).
          anonymous_enable=NO
       #
       # Uncomment this to allow local users to log in.
          local_enable=YES
       #
       # Uncomment this to enable any form of FTP write command.
          write_enable=YES
       #
       # Default umask for local users is 077. You may wish to
        change this to 022,
       # if your users expect that (022 is used by most other
         ftpd’s)
          local_umask=022
       #
       # Uncomment this to allow the anonymous FTP user to upload
        files. This only
       # has an effect if the above global write enable is
        activated. Also, you will
       # obviously need to create a directory writable by the FTP
        user.
       #anon_upload_enable=YES
       #
       # Uncomment this if you want the anonymous FTP user to be
        able to create
       # new directories.
       #anon_mkdir_write_enable=YES
       #
       # Activate directory messages – messages given to remote 
        users when they
       # go into a certain directory.
          dirmessage_enable=YES
       #
       # Activate logging of uploads/downloads.
          xferlog_enable=YES
       #
    hanya cukup mengganti opsi dari anonymous_enable=YES menjadi NO dan local_enable=NO menjadi YES. itu saja sudah cukup menjadi ftp server.
  7. Jika sudah simpan hasil perubahan dengan ESC:wq
  8. Kemudian restart lah service dari vsftpd
  9. [root@ardysmart]# service vsftpd restart
  10. Kemudian buat user lokal dengan nama ardyftp (unuk nama user bebas)
  11. [root@ardysmart]# adduser ardyftp
  12. Kemudian buat password
  13. [root@ardysmart]# passwd ardyftp
    Changing password for user ozotmacho.
    New UNIX password:********
    BAD PASSWORD: it is too simplistic/systematic
    Retype new UNIX password:********
    passwd: all authentication tokens updated successfully.
  14. Membuat file chroot_list 
  15. [root@ardysmart]# vim /etc/vsftpd/chroot_list
    Isinya adalah :
    ardyftp
    1. Restart Service FTP
    2. [root@ardysmart]# service vsftpd restart
      [root@ardysmart]# chkconfig vsftpd on
    3. Cek konfigurasi FTP
    4. [root@ardysmart]# getsebool -a | grep ftp
      nah dibagian ini saya mendapatkan status : getsebool: SELinux is disabled maka untuk mengatasi hal tersebut saya edit file :
      [root@ardysmart]# vi /etc/selinux/config
      FILE sebelum di edit :
      # This file controls the state of SELinux on the system.
      # SELINUX= can take one of these three values:
      # enforcing – SELinux security policy is enforced.
      # permissive – SELinux prints warnings instead of enforcing.
      # disabled – SELinux is fully disabled.
      SELINUX=disable
      # SELINUXTYPE= type of policy in use. Possible values are:
      # targeted – Only targeted network daemons are protected.
      # strict – Full SELinux protection.
      SELINUXTYPE=targeted
      Kemudian saya edit menjadi :
      # This file controls the state of SELinux on the system.
      # SELINUX= can take one of these three values:
      # enforcing – SELinux security policy is enforced.
      # permissive – SELinux prints warnings instead of enforcing.
      # disabled – SELinux is fully disabled.
      SELINUX=permisive
      # SELINUXTYPE= type of policy in use. Possible values are:
      # targeted – Only targeted network daemons are protected.
      # strict – Full SELinux protection.
      SELINUXTYPE=targeted
      Save dengan ESC:wq
    5. Kemudian reboot komputer dengan perintah #shutdown -r now setelah komputer di reboot jalankan kenbali command :
    6. [root@ardysmart]# getsebool -a | grep ftp
      kemudian akan muncul seperti ini :
      allow_ftpd_anon_write –> off
      allow_ftpd_full_access –> off
      allow_ftpd_use_cifs –> off
      allow_ftpd_use_nfs –> off
      allow_tftp_anon_write –> off
      ftp_home_dir –> on
      ftpd_disable_trans –> off
      ftpd_is_daemon –> on
      httpd_enable_ftp_server –> off
      tftpd_disable_trans –> off

      Apabila ftp_home_dir masih berstatus off, maka jalankan perintah :
      [root@ardysmart]# setsebool -P ftp_home_dir on
      [root@ardysmart]# iptables -F
    7. gunakan aplikasi FTP client seperti GFTP, FILEZILA atau WINSCP untuk login dan mengupload / download file di server
    8. gunakan BROWSER jika ingin mendownload saja, tanpa upload
    SEKIAN DULU POSTINGAN SAYA HARI INI

    SELAMAT MENCOBA
    BY : ARDY SMART
    gin: http://adsensecamp.com/ -->

    1 komentar: