F. Instalasi & Konfigurasi Samba Server

  1. Prerequisites (Prasyarat)
    1. Topologi Jaringan

      Gambar Topologi Jaringan

       

    2. Konfigurasi Server dan Client

      Konfigurasi Server :
      --------------------------------------------------
      - Sistem Operasi        : Linux Debian 10 (Buster)
      - IP Address NIC 1      : DHCP Internet
      - Gateway               : DHCP Internet
      
      - Hostname              : ns100             (Gantilah angka 100 dengan nomer absen anda masing-masing)
      - Domain                : sekolah100.sch.id (Gantilah angka 100 dengan nomer absen anda masing-masing)
      - IP Address NIC 2      : 192.168.100.1/24  (Gantilah angka 100 dengan nomer absen anda masing-masing)
      
      
      Konfigurasi Client :
      --------------------------------------------------
      - Sistem Operasi        : Windows
      - IP Address            : DHCP

     

  2. Seting Server

    1. DHCP Server

      Pastikan instalasi dan konfigurasi DHCP server sudah berjalan dengan baik

    2. Instalasi dan Konfigurasi Samba Server

        • Install paket Samba Server

          Login sebagai user root

          login as: root
          This email address is being protected from spambots. You need JavaScript enabled to view it..1's password:
          
          Linux ns100 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-09-05) x86_64
          
          The programs included with the Debian GNU/Linux system are free software;
          the exact distribution terms for each program are described in the
          individual files in /usr/share/doc/*/copyright.

           

          Lakukan update dan upgrade debian Buster

          root@ns100:~# apt update
          Get:1 http://mirror.smkn1klaten.sch.id/debian buster InRelease [122 kB]
          Get:2 http://mirror.smkn1klaten.sch.id/debian buster-updates InRelease [51.9 kB]
          Get:3 http://mirror.smkn1klaten.sch.id/debian-security buster/updates InRelease [65.4 kB]
          Ign:4 http://mirror.smkn1klaten.sch.id/debian buster/non-free Sources
          Ign:5 http://mirror.smkn1klaten.sch.id/debian buster/contrib Sources
          Ign:6 http://mirror.smkn1klaten.sch.id/debian buster/main Sources
          Ign:7 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 Packages
          Fetched 23.0 MB in 15s (1,528 kB/s)
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          25 packages can be upgraded. Run 'apt list --upgradable' to see them.
          N: Repository 'http://mirror.smkn1klaten.sch.id/debian buster InRelease' changed its 'Version' value from '10.10' to '10.11'
          N: Repository 'http://mirror.smkn1klaten.sch.id/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
          N: Repository 'http://mirror.smkn1klaten.sch.id/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
          N: Repository 'http://mirror.smkn1klaten.sch.id/debian-security buster/updates I nRelease' changed its 'Suite' value from 'stable' to 'oldstable'
          
          
          root@ns100:~# apt upgrade  
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          Calculating upgrade... Done
          The following NEW packages will be installed:
            linux-image-4.19.0-18-amd64
          The following packages will be upgraded:
            base-files bind9-host debconf debconf-i18n distro-info-data krb5-locales libbind9-161
            libdns-export1104 libdns1104 libgssapi-krb5-2 libirs-export161 libisc-export1100 libisc1100
            libisccc161 libisccfg-export163 libisccfg163 libk5crypto3 libkrb5-3 libkrb5support0
            liblwres161 libssl1.1 linux-image-amd64 openssl python3-debconf tzdata
          25 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
          Need to get 57.2 MB of archives.
          After this operation, 270 MB of additional disk space will be used.
          Do you want to continue? [Y/n] y
          Get:1 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 base-files amd64 10.3+deb10u11 [69.9 kB]
          Get:2 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 debconf-i18n all 1.5.71+deb10u1 [206 kB]
          Get:3 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 python3-debconf all 1.5.71+deb10u1 [4,028 B]
          Setting up libdns-export1104 (1:9.11.5.P4+dfsg-5.1+deb10u6) ...
          Setting up libisccfg-export163 (1:9.11.5.P4+dfsg-5.1+deb10u6) ...
          Setting up libgssapi-krb5-2:amd64 (1.17-3+deb10u3) ...
          Setting up libirs-export161 (1:9.11.5.P4+dfsg-5.1+deb10u6) ...
          Processing triggers for man-db (2.8.5-2) ...
          Processing triggers for libc-bin (2.28-10) ...
          

           

          Instal paket samba server

          root@ns100:~# apt install samba
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          The following additional packages will be installed:
            libnss3 libpython2.7 librados2 libtalloc2 libtdb1 libtevent0 libtirpc-common libtirpc3 libwbclient0 pinentry-curses
            python-crypto python-dnspython python-gpg python-ldb python-samba python-talloc python-tdb samba samba-common
            samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools
          0 upgraded, 60 newly installed, 0 to remove and 0 not upgraded.
          Need to get 37.3 MB of archives.
          After this operation, 131 MB of additional disk space will be used.
          Do you want to continue? [Y/n]y
          Get:1 http://mirror.smkn1klaten.sch.id/debian-security buster/updates/main amd64 libwbclient0 amd64 2:4.9.5+dfsg-5+deb10u1            [132 kB]
          Get:2 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 python-dnspython all 1.16.0-1+deb10u1 [90.2 kB]
          Get:3 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 python-crypto amd64 2.6.1-9+b1 [259 kB]
          

           

          Gambar. install paket Samba server

          Created symlink /etc/systemd/system/multi-user.target.wants/smbd.service → /lib/systemd/system/smbd.service.
          Processing triggers for systemd (241-7~deb10u8) ...
          Processing triggers for man-db (2.8.5-2) ...
          Processing triggers for libc-bin (2.28-10) ...
          

           

        • Membuat direktori dan user samba.

          Membuat direktori dan user authentication (user dengan login dan password)

          root@ns100:~# mkdir /home/private
          root@ns100:~# useradd smk
          root@ns100:~# smbpasswd -a smk
          New SMB password: 123
          Retype new SMB password: 123
          Added user smk.
          
          root@ns100:~# chown -R smk:smk /home/private
          root@ns100:~# chmod -R 775 /home/private
          

          Membuat direktori share dan user share (user tanpa login dan password)

          root@ns100:~# mkdir /home/share
          root@ns100:~# useradd -rs /bin/false user-share
          root@ns100:~# chown -R user-share /home/share
          root@ns100:~# chmod -R 777 /home/share
          

       

        • Konfigurasi file /etc/samba/smb.conf

          Tambahkan atau copykan script berikut ini di bagian paling akhir file smb.conf

           

          [private]
             comment = direktori untuk User Authentication (login password)
             path = /home/private
             browseable = yes
             writeable = yes
             guest ok = no
             valid users = smk
          
          [share]
             comment = Share untuk User Anonymous (tanpa login password)
             path = /home/share
             guest ok = yes
             browseable = yes
             writeable = yes
             force user = user-share
          

           

          root@ns100:~# nano /etc/samba/smb.conf
          [private]
             comment = direktori untuk User Authentication (login password)
             path = /home/private
             browseable = yes
             writeable = yes
             guest ok = no
             valid users = smk
          
          [share]
             comment = Share untuk User Anonymous (tanpa login password)
             path = /home/share
             guest ok = yes
             browseable = yes
             writeable = yes
             force user = user-share
          

           

          Gunakan perintah testparm untuk mengetahui dan menguji apakah terdapat paramater yang salah pada penulisan script di file smb.conf

          root@ns100:~# testparm
          rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
          Registered MSG_REQ_POOL_USAGE
          Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
          Load smb config files from /etc/samba/smb.conf
          rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
          Processing section "[homes]"
          Processing section "[printers]"
          Processing section "[print$]"
          Processing section "[private]"
          Processing section "[share]"
          Loaded services file OK.
          Server role: ROLE_STANDALONE
          
          Press enter to see a dump of your service definitions [Tekan Enter]
          
          [private]
                  comment = direktori untuk User Authentication (login password)
                  path = /home/private
                  read only = No
                  valid users = smk
          
          
          [share]
                  comment = Share untuk User Anonymous (tanpa login password)
                  force user = user-share
                  guest ok = Yes
                  path = /home/share
                  read only = No
          

           

          Restart service samba

          root@ns100:~# /etc/init.d/samba-ad-dc restart
                                      

          Melihat status samba sudah aktif atau belum

          root@ns100:~# /etc/init.d/smbd status
           smbd.service - Samba SMB Daemon
             Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
             Active: active (running) since Sat 2021-11-20 09:53:55 WIB; 5h 50min ago
          Nov 20 15:19:40 ns100 smbd[8227]: pam_unix(samba:session): session closed f…body
          Hint: Some lines were ellipsized, use -l to show in full.
          
          root@ns100:~# /etc/init.d/nmbd status
           nmbd.service - Samba NMB Daemon
             Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
             Active: active (running) since Sat 2021-11-20 09:53:56 WIB; 5h 51min ago
               Docs: man:nmbd(8)
                     man:samba(7)
          Nov 20 09:53:58 ns100 systemd[1]: /lib/systemd/system/nmbd.service:9: PIDF…ngly.
          Hint: Some lines were ellipsized, use -l to show in full.
          

       

      • Pengujian Samba Server di client

        Bersihkan terlebih dahulu network drive, barangkali sebelumnya client sudah terhubung ke NFS lain, gunakan perintah DOS yaitu CMD kemudian ketikkan net use * /delete

        Gambar. Membersihkan network drive

         

        Selanjutnya klik Start - Run kemudian ketikkan alamat samba server lalu tekan OK

        Gambar. Akses ke Samba Server

         

        Akan muncul jendela network folder dari samba server yang telah kita buat sebelumnya.

        Gambar. Akses ke Samba Server

         

        Kemudian klik folder private

        Gambar. Jendela Network Folder Samba Server

         

        Ketikan pada kolom User name : smk dan Password : 123 lalu klik OK

        Gambar. Jendela user authentication Samba Server

         

        Kita coba untuk membuat satu folder dengan cara klik kanan kemudian pilih New Folder

        Gambar. Membuat folder di Samba Server

         

        Berikutnya kita coba untuk meng-akses folder share dan membuat satu file atau folder disana.

        Gambar. Akses folder share

         

        Kita coba untuk membuat satu folder dengan cara klik kanan kemudian pilih New Folder

        Gambar. Akses folder share

         

        Gambar. Akses folder share

         

      • Mengakhiri hubungan atau koneksi dengan Samba server

        Langkah terakhir kita dapat logout atau mengakhiri koneksi dengan samba server dengan menggunakan perintah net use

        Gambar. Mengakhiri koneksi dengan samba server.

         

    3. Kesimpulan

      Selamat! akhirnya kita telah belajar dan berhasil melakukan instalasi dan konfigurasi File Server menggunakan Samba

       

       

OkCancel