Apa fungsi konfigurasi file etc pam.d samba

Samba adalah keluarga alat penanganan protokol SMB (juga dikenal sebagai "CIFS") di Linux. Protokol ini digunakan oleh Windows untuk share jaringan dan pencetak bersama.

Samba juga dapat bertindak sebagai pengontrol domain Windows. Ini adalah alat yang luar biasa untuk memastikan mulusnya integrasi server Linux dan mesin desktop kantor yang masih menjalankan Windows.

Paket samba berisi dua server utama Samba 4, smbd dan nmbd.

11.5.1.1. Menata konfigurasi dengan debconf

The package sets up a minimal configuration during the initial installation in /etc/samba/smb.conf by plainly copying /usr/share/samba/smb.conf. So you should really run dpkg-reconfigure samba-common to adapt it:

Pada instalasi pertama, informasi yang diperlukan adalah hanya nama workgroup yang akan diikuti oleh server Samba (jawabannya adalah FALCOTNET dalam kasus kita).

Dalam kasus pemutakhiran paket (dari versi Debian old stable) atau bila server SMB telah dikonfigurasi untuk memakai suatu server WINS (wins server), paket juga mengusulkan mengidentifikasi server WINS dari informasi yang diberikan oleh daemon DHCP. Para administrator Falcot Corp menolak pilihan ini, karena mereka berniat untuk menggunakan server Samba itu sendiri sebagai server WINS.

11.5.1.2. Mengkonfigurasi Secara Manual

11.5.1.2.1. Perubahan atas smb.conf

Persyaratan di Falcot membutuhkan pilihan lainnya untuk diubah di berkas konfigurasi /etc/samba/smb.conf. Kutipan-kutipan berikut meringkas perubahan yang dilakukan di bagian [global].

[...] [global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = FALCOTNET [...] # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server wins support = yes
Apa fungsi konfigurasi file etc pam.d samba
[...] ####### Authentication ####### # Server role. Defines in which mode Samba will operate. Possible # values are "standalone server", "member server", "classic primary # domain controller", "classic backup domain controller", "active # directory domain controller". # # Most people will want "standalone server" or "member server". # Running as "active directory domain controller" will require first # running "samba-tool domain provision" to wipe databases and create a # new domain. server role = standalone server obey pam restrictions = yes [...] # "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. security = user
Apa fungsi konfigurasi file etc pam.d samba
[...]

Apa fungsi konfigurasi file etc pam.d samba

Indicates that Samba should act as a Netbios name server (WINS) for the local network. This option had been removed from the default configuration in Buster and must be added manually if desired.

Apa fungsi konfigurasi file etc pam.d samba

Ini adalah nilai default untuk parameter ini; namun karena itu pusat bagi konfigurasi Samba, mengisinya secara eksplisit direkomendasikan. Setiap pengguna harus mengotentikasi sebelum mengakses share apapun.

11.5.1.2.2. Menambahkan Pengguna

Setiap pengguna Samba perlu sebuah akun di server; akun Unix harus dibuat terlebih dahulu, kemudian pengguna perlu didaftarkan di basis data Samba. Langkah Unix dilakukan secara normal (menggunakan adduser misalnya).

Menambahkan pengguna ke basis data Samba adalah sekedar menjalankan perintah smbpasswd -a pengguna; perintah ini meminta kata sandi secara interaktif.

Pengguna dapat dihapus dengan perintah smbpasswd - x pengguna. Akun Samba juga dapat sementara dinonaktifkan (dengan smbpasswd -d pengguna) dan diaktifkan kembali kemudian (dengan smbpasswd -e pengguna).

Fitur klien di Samba memungkinkan mesin Linux untuk mengakses share Windows dan pencetak bersama. Program yang diperlukan tersedia dalam paket yang cifs-utils dan smbclient.

11.5.2.1. Program smbclient

Program smbclient meng-query server SMB. Menerima opsi -U pengguna, untuk menghubungkan ke server di bawah identitas tertentu. smbclient //server/share mengakses share dengan cara interaktif yang mirip dengan baris perintah klien FTP. smbclient -L server menampilkan daftar seluruh share yang tersedia (dan terlihat) pada server.

11.5.2.2. Mengait Share Windows

Perintah mount memungkinkan mengait share Windows ke dalam hirarki sistem berkas Linux (dengan bantuan dari mount.cifs yang disediakan oleh cifs-utils).

Contoh 11.21. Mengait suatu share Windows

mount -t cifs //arrakis/shared /shared \ -o credentials=/etc/smb-credentials

Berkas /etc/smb-credentials (yang harus tidak bisa dibaca oleh pengguna) memiliki format berikut:

username = pengguna password = kata sandi

Opsi lain dapat dinyatakan pada baris perintah; daftar lengkap mereka tersedia di halaman manual mount.cifs(1). Dua opsi secara khusus bisa menarik: uid dan gid memungkinkan memaksa pemilik dan kelompok berkas yang tersedia saat mount, agar tidak membatasi akses ke root.

Mount share Windows juga dapat dikonfigurasi di /etc/fstab:

//server/shared /shared cifs credentials=/etc/smb-credentials

Unmounting an SMB/CIFS share is done with the standard umount command.

11.5.2.3. Pencetakan pada Pencetak Bersama

CUPS adalah solusi elegan untuk mencetak dari workstation Linux ke pencetak yang dibagikan oleh mesin Windows. Ketika smbclient dipasang, CUPS memungkinkan instalasi pencetak bersama Windows secara otomatis.

Ini adalah langkah-langkah yang diperlukan:

  • Masukkan konfigurasi antarmuka CUPS: http://localhost:631/admin

  • Klik pada "Tambah Pencetak".

  • Pilih perangkat pencetak, pilih "Pencetak Windows melalui SAMBA".

  • Masukkan URI koneksi untuk pencetak jaringan. Seharusnya terlihat seperti berikut:

    smb://pengguna:katasandi@server/pencetak.

  • Masukkan nama yang akan mengidentifikasi pencetak ini secara unik. Kemudian masukkan keterangan dan lokasi pencetak. Mereka adalah string yang akan ditampilkan kepada pengguna akhir untuk membantu mereka mengidentifikasi pencetak.

  • Tunjukkan produsen/model pencetak, atau langsung berikan sebuah berkas deskripsi pencetak (PPD) yang bekerja.

Voilà, pencetak operasional!

Pada artikel kali ini kita akan membahas mengenai cara konfigurasi file server menggunakan LDAP Samba PDC. Sebelum masuk bagian konfigurasi ada baiknya kita bahas dulu mengenai Samba. Samba merupakan suatu aplikasi unix yang menyembatani komunikasi dengan mesin lain menggunakan protokol SMB (Server Message Block) dan di gunakan untuk berbagi file, printer, serial port dan lainnya agar dapat di gunakan secara bersama pada komputer yang terhubung ke jaringan. Sedangan OpenLDAP merupakan server Lightweight Directory Access Protocol (LDAP) yang biasa digunakan sebagai buku alamat atau media penyimpanan informasi user dan password. Jadi LDAP Samba PDC adalah sebuah Active Directory Server yang merupakan gabungan antara Samba dan OpenLDAP yang tergintergrated menjadi sebuah system yang di fungsikan sebagai Primary Domain Controller (PDC).

Pada percobaan kali ini peralatan yang digunakan adalah sebagai berikut :
- 1 unit PC yang sudah terinstall linux CentOS 5.7 32 bit dengan IP Address 192.168.56.20 yang nantinya akan dijadikan server LDAP Samba PDC  dengan LDAP suffix dc=acenk90,dc=local. - 2 unit PC Client yang masing-masing sudah terinstall Windows XP dan Windows 7

Apa fungsi konfigurasi file etc pam.d samba



Baiklah langsung saja kita masuk ke bagian konfigurasi LDAP + Samba PDC menggunakan Linux CentOS 5.7. Langkah-langkah yang dilakukan adalah seperti berikut:

  1. Pertama hubungkan server dengan internet dan lakukan pengecheckan IP Address pada server yang akan kita jadikan LDAP Samba PDC dengan mengetikkan perintah : ifconfig

    Pada terminal anda pastikan IP Address untuk network interfacenya sudah di setting seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  2. Download repository epel untuk centos 5.x 32 bit dengan mengetikkan perintah : wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

    Pada terminal linux CentOS server anda dan pastikan proses download success seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  3. Lakukan installasi paket rpm repository epel yang telah kita download tadi dengan megetikkan perintah : rpm -ivh epel-release-5-4.noarch.rpm

    Pada terminal linux CentOS server anda dan pastikan success seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  4. Selanjutnya lakukan installasi package openldap, openldap server , open ldap cilet, nss ldap, samba client, dan samba common dengan cara metikkan perintah : yum install openldap openldap-clients openldap-servers nss_ldap samba samba-client samba-common

    Pada terminal linux CentOS server anda dan pastikan semua paket yang dibutuhkan succes terinstall.

    Apa fungsi konfigurasi file etc pam.d samba

  5. Setelah itu installkan packet smbldap-tools melalui repository epel yang telah installkan sebelumnya dengan mengetikkan perintah : yum --enablerepo=epel install smbldap-tools

    Pada terminal linux CentOS Server anda dan pastikan paket smbldap-tools success terinstall.

    Apa fungsi konfigurasi file etc pam.d samba

  6. Generate password ldap master dengan mengetikkan perintah : slappasswd

    Masukkan password yang anda inginkan, lalu copykan hasil engkripsi SHA password LDAP master tersebut pada tempat lain karena akan kita gunakan pada konfigurasi slapd.conf nantinya.

    Apa fungsi konfigurasi file etc pam.d samba

  7. Edit file konfigurasi sldap.conf menggunakan text editor kesukaan anda. Pada percobaan kali ini kita menggunakan text editor nano dengan mengetikkan perintah : nano /etc/openldap/slapd.conf

    Pada terminal linux anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  8. Edit file konfigurasi slapd.conf menjadi seperti berikut ini dan sesuaikan suffix LDAP nya sesuai kebutuhan anda kemudian save. # # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema include /etc/openldap/schema/samba.schema # Allow LDAPv2 client connections. This is NOT the default. allow bind_v2 # Do not enable referrals until AFTER you have a working directory # service AND an understanding of referrals. #referral ldap://root.openldap.org pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args # Load dynamic backend modules: # modulepath /usr/lib/openldap # Modules available in openldap-servers-overlays RPM package # Module syncprov.la is now statically linked with slapd and there # is no need to load it here # moduleload accesslog.la # moduleload auditlog.la # moduleload denyop.la # moduleload dyngroup.la # moduleload dynlist.la # moduleload lastmod.la # moduleload pcache.la # moduleload ppolicy.la # moduleload refint.la # moduleload retcode.la # moduleload rwm.la # moduleload smbk5pwd.la # moduleload translucent.la # moduleload unique.la # moduleload valsort.la # modules available in openldap-servers-sql RPM package: # moduleload back_sql.la # The next three lines allow use of TLS for encrypting connections using a # dummy test certificate which you can generate by changing to # /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on # slapd.pem so that the ldap user or group can read it. Your client software # may balk at self-signed certificates, however. # TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt # TLSCertificateFile /etc/pki/tls/certs/slapd.pem # TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem # Sample security restrictions # Require integrity protection (prevent hijacking) # Require 112-bit (3DES or better) encryption for updates # Require 63-bit encryption for simple bind # security ssf=1 update_ssf=112 simple_bind=64 # Sample access control policy: # Root DSE: allow anyone to read it # Subschema (sub)entry DSE: allow anyone to read it # Other DSEs: # Allow self write access # Allow authenticated users read access # Allow anonymous users to authenticate # Directives needed to implement policy: access to dn.base="" by self write by * auth access to attrs=userPassword by self write by * auth access to attrs=shadowLastChange by self write by * read access to * by * read by anonymous auth # # if no access controls are present, the default policy # allows anyone and everyone to read anything but restricts # updates to rootdn. (e.g., "access to * by * read") # # rootdn can always read and write EVERYTHING! ####################################################################### # ldbm and/or bdb database definitions ####################################################################### database bdb suffix "dc=acenk90,dc=local" rootdn "cn=Manager,dc=acenk90,dc=local" # Cleartext passwords, especially for the rootdn, should # be avoided. See slappasswd(8) and slapd.conf(5) for details. # Use of strong authentication encouraged. # rootpw secret rootpw {SSHA}6mDuJHqi0Pu4iAJ6uQXOJ4so0wxKlXlj //copykan sha password LDAP Master tadi kesini # The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools. # Mode 700 recommended. directory /var/lib/ldap # Indices to maintain for this database index objectClass eq index cn pres,sub,eq index sn pres,sub,eq index uid pres,sub,eq index displayName pres,sub,eq index uidNumber eq index gidNumber eq index memberUID eq index sambaSID eq index sambaPrimaryGroupSID eq index sambaDomainName eq index default sub # Replicas of this database #replogfile /var/lib/ldap/openldap-master-replog #replica host=ldap-1.example.com:389 starttls=critical # bindmethod=sasl saslmech=GSSAPI # authcId=host/
  9. Copykan file konfigurasi samba.schema dengan mengetikkan perintah : cp /usr/share/doc/samba-3.*/LDAP/samba.schema /etc/openldap/schema/samba.schema

    Pada terminal linux CentOS anda, seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  10. Copykan file DB_CONFIG untuk LDAP Server dengan mengetikkan perintah : cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

    Pada terminal linux CentOS server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  11. Rubah hak akses pada file DB_CONFIG yang telah kita copykan tadi agar dapat diakses dan eksekusi oleh LDAP Server dengan mengerikkan perintah : chown -R ldap:ldap /var/lib/ldap/DB_CONFIG chmod 600 /var/lib/ldap/DB_CONFIG

    Pada terminal linux CentOS server anda seperti tampilan berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  12. Selanjutnya buat file konfigurasi init.ldif dan letakkan di dalam directory /etc/openldap dengan cara mengetikkan perintah : nano /etc/openldap/init.ldif

    Pada terminal linux CentOS server anda seperti gambar berikut ini.

    Apa fungsi konfigurasi file etc pam.d samba

  13. Isikan file konfigurasi init.ldif sesuai suffix ldap server kebutuhan anda seperti berikut : dn: dc=acenk90,dc=local objectclass: dcObject objectclass: organization dc: acenk90 o: acenk90 description: Samba LDAP Acenk90 Data Center dn: cn=Manager,dc=acenk90,dc=local objectClass: organizationalRole cn: Manager description: Directory Manager

    Kemudian save konfigurasi tersebut seperti gambar berikut ini.

    Apa fungsi konfigurasi file etc pam.d samba

  14. Jalankan service ldap dengan mengetikkan perintah: service ldap start

    Agar service ldap server anda aktif saat start-up maka aktifkan dengan mengetikkan perintah :

    chkconfig ldap on

    Pastikan kedua langkah tersebut succes seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  15. Kemudian add file konfigurasi init.ldif yang telah dibuat tadi ke dalam ldap server dengan cara mengetikkan perintah: ldapadd -v -D "cn=Manager,dc=acenk90,dc=local" -x -w 12345 -f /etc/openldap/init.ldif

    Isikan suffix dan password ldap yang telah diberikan sebelumnya seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  16. Rubah kepemilikkan serta hak akses file ldap berserta recursive file dan directorynya yang terdapat pada directory /va/lib/ menjadi kepemilikkan ldap dengan mengetikkan perintah : chown -R ldap:ldap /var/lib/ldap/ chmod -R 600 /var/lib/ldap/*

    Pada terminal linux CentOS server anda seperti gambar berikut ini.

    Apa fungsi konfigurasi file etc pam.d samba

  17. Selanjutnya untuk meload konfigurasi ldap yang telah kita konfigurasi tadi maka ketikkan perintah: slapcat

    Pada terminal linux CentOS server anda dan pastikan outputnya success seperti tampilan gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  18. Untuk mengecek konfigurasi ldap yang sudah di add kan kedalam system ldap server sebelumnya. Maka dapat dicheck dengan mengetikkan perintah : ldapsearch -x -b "dc=acenk90,dc=local"

    Pada terminal linux CentOS server anda dan pastikan outputnya sesuai seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  19. Selanjutnya masuk pada bagian konfigurasi user lookup dan authentication dengan cara mengetikkan perintah: authconfig-tui

    Pada terminal linux CentOS server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  20. Pilih User Information dan Authentication seperti gambar di bawah ini, kemudian next dan tekan Enter.
    Apa fungsi konfigurasi file etc pam.d samba
  21. Untuk LDAP settingan sesuaikan dengan IP Address server LDAP dan suffix ldap yang anda gunakan. Seperti gambar di bawah ini kemudian pilih OK dan tekan Enter.
    Apa fungsi konfigurasi file etc pam.d samba
  22. Setelah proses konfigurasi user lookup dan authentication selesai, maka service nscd akan otomatis restart seperti gambar berikut.
    Apa fungsi konfigurasi file etc pam.d samba
  23. Selanjutnya masuk kebagian konfigurasi samba. Tahap pertama yang harus dilakukan yaitu backup terlebih dahulu konfigurasi default samba dengan dengan mengetikkan perintah : mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

    Pada terminal Linux CentOS anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  24. Kemudian copykan file configurasi samba baru yang nantinya akan kita integratedkan dengan ldap server dengan cara mengetikkan perintah : cp /usr/share/doc/smbldap-tools-0.9.6/smb.conf /etc/samba/smb.conf

    Pada terminal Linux CentOS anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  25. Edit file konfigurasi smb.conf yang telah kita copykan tadi menggunakan text editor nano dengan mengetikkan perintah: nano /etc/samba/smb.conf

    Pada terminal linux CentOS Server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  26. Edit file konfigurasi samba smb.conf seperti berikut. Jika anda menggunakan suffix ldap dan path directory share yang berbeda maka sesuaikan dengan kebutuhan anda. # Global parameters [global] workgroup = ACENK90 netbios name = DATA-CENTER interfaces = eth0 server string = ACENK90 security = user encrypt passwords = Yes bind interfaces only = No passdb backend = ldapsam:ldap://localhost client NTLMv2 auth = Yes client lanman auth = No client plaintext auth = No log level = 2 syslog = 1 log file = /var/log/samba/%m max log size = 0 smb ports = 139 445 name resolve order = wins time server = Yes server signing = auto add user script = /usr/sbin/smbldap-useradd -m '%u' add group script = /usr/sbin/smbldap-groupadd '%g' add user to group script = /usr/sbin/smbldap-groupmod -m '%u' '%g' set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u' add machine script = /usr/sbin/smbldap-useradd -w '%u' logon script = logon.bat logon drive = logon path = logon home = domain logons = Yes os level = 34 preferred master = Yes domain master = Yes wins support = Yes ldap admin dn = "cn=Manager,dc=acenk90,dc=local" ldap user suffix = ou=People ldap group suffix = ou=Group ldap idmap suffix = ou=Idmap ldap machine suffix = ou=Hosts ldap passwd sync = Yes ldap suffix = dc=acenk90,dc=local ldap ssl = no ldap timeout = 100 idmap backend = ldap:ldap://localhost idmap uid = 15000-20000 idmap gid = 15000-20000 winbind nested groups = Yes ea support = Yes map acl inherit = Yes inherit acls = Yes nt acl support = Yes force unknown acl user = Yes socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE</code> [Homes] comment = Home Directory %U, %u valid users = %U veto files = /*.mp3/*.wmv/*.avi/*.wma/*.wav/*.mpg/*.mpeg/*.mp4/*.MP3/*.WMV/*.AVI/*.WAV/*.MOV/*.MPG/*.MPEG/*.MP4/ delete veto files = Yes read only = No writable = Yes browseable = No guest ok = no create mask = 0700 directory mask = 0700 root preexec = /etc/samba/smb-preexec.sh "%u" "%g" [printers] comment = SMB Print Spool guest ok = No printable = No browseable = No use client driver = No disable spoolss = Yes load printers = No printing = none printcap name = /dev/null show add printer wizard = No guest account = nobody map to guest = Never [public] comment = Directory For Public path = /home/public hide dot files = yes read only = No force create mode = 0777 force directory mode = 0777 browsable = yes veto files = /*.mp3/*.wmv/*.avi/*.wma/*.wav/*.mpg/*.mpeg/*.mp4/*.MP3/*.WMV/*.AVI/*.WAV/*.MOV/*.MPG/*.MPEG/*.MP4/ delete veto files = Yes [teams] comment = Directory For Teams path = /home/teams hide dot files = yes read only = No force create mode = 0777 force directory mode = 0777 browsable = yes veto files = /*.mp3/*.wmv/*.avi/*.wma/*.wav/*.mpg/*.mpeg/*.mp4/*.MP3/*.WMV/*.AVI/*.WAV/*.MOV/*.MPG/*.MPEG/*.MP4/ delete veto files = Yes [netlogon] comment = Network Logon Service path = /home/netlogon browseable = No read only = No invalid users = root writable = Yes
  27. Buat file konfigurasi smb-preexec.sh di dalam directory /etc/samba dengan mengetikkan perintah: nano /etc/samba/smb-preexec.sh

    Scripts ini nantinya akan difungsikan sebagai file konfigurasi pembuatan home directory otomatis saat user login ke system Domain ACENK90 nantinya.

    Apa fungsi konfigurasi file etc pam.d samba

  28. Isikan si file konfigurasi smb-preexec.sh seperti gambar berikut ini
    Apa fungsi konfigurasi file etc pam.d samba
  29. Selanjutnya melakukan konfigurasi pada file konfigurasi pam login yang terletak di dalam directory /etc/pam.d/ dengan cara mengetikkan perintah : nano /etc/pam.d/login

    Pada terminal linux CentOS server anda seperti pada gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  30. Tambahkan konfigurasi berikut : session required pam_mkhomedir.so skel=/etc/skel/ umask=0077

    Pada bagian akhir konfigurasi, kemudian save konfigurasi tersebut seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  31. Edit file konfigurasi smbusers menggunakan text editor nano dengan mengetikkan perintah nano /etc/samba/smbusers

    Melalui terminal linux CentOS anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  32. Tambahkan konfigurasi file smbusers menjadi seperti gambar berikut ini kemudian save konfigurasi tersebut.
    Apa fungsi konfigurasi file etc pam.d samba
  33. Selanjutnya setting samba password dengan cara mengetikkan perintah : smbpasswd -w 12345

    Sesuaikan passwod samba dengan ldap server, dan pastikan sukses seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  34. Selanjutnya restart serivce samba  dan windbind dengan mengetikkan perintah : service smb restart service winbind restart

    Lalu setting agar service samba dan winbind aktif saat startup booting dengan mengetikkan perintah :

    chkconfig smb on chkconfig winbind on

    Pada terminal linux CentOS Server anda dan pastikan success seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  35. Setelah itu check konfigurasi samba-ldap yang sudah kita konfigurasi tadi dengan mengetikkan perintah : testparm

    Pastikan outputnya benar dan path-path file share nya sesuai, seperti gambar di bawah ini

    Apa fungsi konfigurasi file etc pam.d samba

  36. Selanjutnya konfigurasi samba-ldap-tools, sebelumnya melakukan konfigurasi backup terlebih dahulu file konfigurasi smbldap.conf dengan mengetikkan perintah : cp /etc/smbldap-tools/smbldap.conf /etc/smbldap-tools/smbldap.conf.bak

    Pada terminal linux CentOS server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  37. Check SID netbios untuk samba yang telah kta setting sebelumnya dengan mengetikkan perintah : net getlocalsid

    Pada terminal linux CentOS server anda, dan pastikan outpunya sesuai dengan domain netbios yang telah kita konfigurasi sebelumnya. Kemudian copykan SID tersebut karena akan kita menggunakannya untuk settingan file konfigurasi samba ldap tool nantinya.

    Apa fungsi konfigurasi file etc pam.d samba

  38. Edit file konfigurasi samba ldap tool dengan mengetikkan menggunakan text editor nano dengan cara mengetikkan perintah : nano /etc/smbldap-tools/smbldap.conf

    Pada terminal linux CentOS server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  39. Isikan file konfigurasi smbldap.conf seperti berikut: # $Id: smbldap.conf 35 2011-02-23 09:07:36Z fumiyas $ # # smbldap-tools.conf : Q & D configuration file for smbldap-tools #  This code was developped by IDEALX (http://IDEALX.org/) and #  contributors (their names can be found in the CONTRIBUTORS file). # #                 Copyright (C) 2001-2002 IDEALX # #  This program is free software; you can redistribute it and/or #  modify it under the terms of the GNU General Public License #  as published by the Free Software Foundation; either version 2 #  of the License, or (at your option) any later version. # #  This program is distributed in the hope that it will be useful, #  but WITHOUT ANY WARRANTY; without even the implied warranty of #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the #  GNU General Public License for more details. # #  You should have received a copy of the GNU General Public License #  along with this program; if not, write to the Free Software #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, #  USA. #  Purpose : #       . be the configuration file for all smbldap-tools scripts ############################################################################## # # General Configuration # ############################################################################## # Put your own SID. To obtain this number do: "net getlocalsid". # If not defined, parameter is taking from "net getlocalsid" return SID="S-1-5-21-3802811248-3637561889-3322353397" # Domain name the Samba server is in charged. # If not defined, parameter is taking from smb.conf configuration file # Ex: sambaDomain="IDEALX-NT" sambaDomain="ACENK90" ############################################################################## # # LDAP Configuration # ############################################################################## # Notes: to use to dual ldap servers backend for Samba, you must patch # Samba with the dual-head patch from IDEALX. If not using this patch # just use the same server for slaveLDAP and masterLDAP. # Those two servers declarations can also be used when you have # . one master LDAP server where all writing operations must be done # . one slave LDAP server where all reading operations must be done #   (typically a replication directory) # Slave LDAP server # Ex: slaveLDAP=127.0.0.1 # If not defined, parameter is set to "127.0.0.1" slaveLDAP="192.168.56.20" # Slave LDAP port # If not defined, parameter is set to "389" slavePort="389" # Master LDAP server: needed for write operations # Ex: masterLDAP=127.0.0.1 # If not defined, parameter is set to "127.0.0.1" masterLDAP="192.168.56.20" # Master LDAP port # If not defined, parameter is set to "389" masterPort="389" # Use TLS for LDAP # If set to 1, this option will use start_tls for connection # (you should also used the port 389) # If not defined, parameter is set to "0" ldapTLS="0" # Use SSL for LDAP # If set to 1, this option will use SSL for connection # (standard port for ldaps is 636) # If not defined, parameter is set to "0" ldapSSL="0" # How to verify the server's certificate (none, optional or require) # see "man Net::LDAP" in start_tls section for more details verify="require" # CA certificate # see "man Net::LDAP" in start_tls section for more details cafile="/etc/smbldap-tools/ca.pem" # certificate to use to connect to the ldap server # see "man Net::LDAP" in start_tls section for more details clientcert="/etc/smbldap-tools/smbldap-tools.iallanis.info.pem" # key certificate to use to connect to the ldap server # see "man Net::LDAP" in start_tls section for more details clientkey="/etc/smbldap-tools/smbldap-tools.iallanis.info.key" # LDAP Suffix # Ex: suffix=dc=IDEALX,dc=ORG suffix="dc=acenk90,dc=local" # Where are stored Users # Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG" # Warning: if 'suffix' is not set here, you must set the full dn for usersdn usersdn="ou=People,${suffix}" # Where are stored Computers # Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG" # Warning: if 'suffix' is not set here, you must set the full dn for computersdn computersdn="ou=Computers,${suffix}" # Where are stored Groups # Ex: groupsdn="ou=Groups,dc=IDEALX,dc=ORG" # Warning: if 'suffix' is not set here, you must set the full dn for groupsdn groupsdn="ou=Group,${suffix}" # Where are stored Idmap entries (used if samba is a domain member server) # Ex: idmapdn="ou=Idmap,dc=IDEALX,dc=ORG" # Warning: if 'suffix' is not set here, you must set the full dn for idmapdn idmapdn="ou=Idmap,${suffix}" # Where to store next uidNumber and gidNumber available for new users and groups # If not defined, entries are stored in sambaDomainName object. # Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}" # Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}" sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}" # Default scope Used scope="sub" # Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA, CLEARTEXT) hash_encrypt="SSHA" # if hash_encrypt is set to CRYPT, you may set a salt format. # default is "%s", but many systems will generate MD5 hashed # passwords if you use "$1$%.8s". This parameter is optional! crypt_salt_format="%s" ############################################################################## # # Unix Accounts Configuration # ############################################################################## # Login defs # Default Login Shell # Ex: userLoginShell="/bin/bash" userLoginShell="/bin/bash" # Home directory # Ex: userHome="/home/%U" userHome="/home/%U" # Default mode used for user homeDirectory userHomeDirectoryMode="700" # Gecos userGecos="System User" # Default User (POSIX and Samba) GID defaultUserGid="513" # Default Computer (Samba) GID defaultComputerGid="515" # Skel dir skeletonDir="/etc/skel" # Default password validation time (time in days) Comment the next line if # you don't want password to be enable for defaultMaxPasswordAge days (be # careful to the sambaPwdMustChange attribute's value) defaultMaxPasswordAge="99999" ############################################################################## # # SAMBA Configuration # ############################################################################## # The UNC path to home drives location (%U username substitution) # Just set it to a null string if you want to use the smb.conf 'logon home' # directive and/or disable roaming profiles # Ex: userSmbHome="\\PDC-SMB3\%U" userSmbHome="\\DATA-CENTER\%U" # The UNC path to profiles locations (%U username substitution) # Just set it to a null string if you want to use the smb.conf 'logon path' # directive and/or disable roaming profiles # Ex: userProfile="\\PDC-SMB3\profiles\%U" userProfile="\\DATA-CENTER\profiles\%U" # The default Home Drive Letter mapping # (will be automatically mapped at logon time if home directory exist) # Ex: userHomeDrive="H:" userHomeDrive="H:" # The default user netlogon script name (%U username substitution) # if not used, will be automatically username.cmd # make sure script file is edited under dos # Ex: userScript="startup.cmd" # make sure script file is edited under dos userScript="logon.bat" # Domain appended to the users "mail"-attribute # when smbldap-useradd -M is used # Ex: mailDomain="idealx.com" mailDomain="acenk90.local" ############################################################################## # # SMBLDAP-TOOLS Configuration (default are ok for a RedHat) # ############################################################################## # Allows not to use smbpasswd (if with_smbpasswd="0" in smbldap.conf) but # prefer Crypt::SmbHash library with_smbpasswd="0" smbpasswd="/usr/bin/smbpasswd" # Allows not to use slappasswd (if with_slappasswd="0" in smbldap.conf) # but prefer Crypt:: libraries with_slappasswd="0" slappasswd="/usr/sbin/slappasswd" # comment out the following line to get rid of the default banner # no_banner="1"

    Sesuaikan konfigurasi suffix dan path2 konfigurasi file samba ldap tools di atas sesuai dengan kebutuhan anda.

  40. Selanjutnya edit file konfigurasi smbldap_bind.conf dengan mengetikkan perintah : nano /etc/smbldap-tools/smbldap_bind.conf

    Pada terminal linux CentOS server anda seperti gambar berikut ini.

    Apa fungsi konfigurasi file etc pam.d samba

  41. Edit file smbldap_bind.conf dan isikan konfigurasi berikut : ############################ # Credential Configuration # ############################ # Notes: you can specify two differents configuration if you use a # master ldap for writing access and a slave ldap server for reading access # By default, we will use the same DN (so it will work for standard Samba # release) slaveDN="cn=Manager,dc=acenk90,dc=local" slavePw="12345" masterDN="cn=Manager,dc=acenk90,dc=local" masterPw="12345"

    Sesuaikan suffix dan password ldap untuk slave dan master sesuai kebutuhan anda kemudian save konfigurasi tersebut seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  42. Rubahlah izin akses file konfigurasi smbldap_bind.conf dengan mengetikkan perintah : chmod -R 600 /etc/smbldap-tools/smbldap_bind.conf

    Pada terminal linux CentOS Server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  43. Selanjutnya untuk untuk melakukan proses penambahan atau adding samba yang telah konfigurasi tadi kedalam ldap server, maka dapat dilakukan dengan mengetikkkan perintah smbldap-populate

    Pada terminal linux CentOS server anda, kemudian anda akan diminta memasukkan sebuah password dan masukkanlah password yang sama dengan password ldap ataupun samba sebelumnya. Jika proses panambaan /adding samba kedalam LDAP server succes maka akan tampil seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  44. Kemudian buat lah directory baru dan beri nama profiles, teams, public di dalam directory home yang berfungsi sebagi path konfigurasi samba yang telah kita konfigurasi sebelumnya. Dengan cara mengetikkan perintah : mkdir /home/profiles mkdir /home/teams mkdir /home/public

    Pada terminal linux CentOS server anda seperti gambar berikut ini.

    Apa fungsi konfigurasi file etc pam.d samba

  45. Rubahlah izin akses apapun file di dalam directory home agar bisa diakses oleh siapapun dengan cara mengetikkan perintah : chmod -R 777 /home/*

    Kemudian berikan group Domain User agar semua user defaultnya mompunya group Domain User dengan cara mengetikkan perintah :

    chgrp ‘Domain Users’ /datasamba/*

    Pada terminal linux CentOS server anda seperti gmabr di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  46. Setelah itu buatlah path untuk netlogon sesuai konfigurasi samba yang telah kita setting sebelumnya dengan membuat directory netlogon di dalam directory home dengan cara mengetikkan perintah : mkdir /home/netlogon

    Kemudian beri izin akses file netlogon tersebut dengan mengetikkan perintah :

    chmod 777 /home/netlogon/

    Pada terminal linux CentOS Server anda seperti gambar di bawah ini.

    Apa fungsi konfigurasi file etc pam.d samba

  47. Selanjutnya buatlah file konfigurasi logon.bat di dalam directory netlogon tadi dengan mengetikkan perintah : nano /home/netlogon/logon.bat

    Melalui terminal linux CentOS server anda seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  48. Agar directory home user, public, dan teams yang telah kita konfigurasi pada samba dapat otomatis mounting/mapping pada setiap user ketika user login, maka isikan konfigurasi seperti gambar berikut pada scripts logon.bat kemudian save konfigurasi tersebut.
    Apa fungsi konfigurasi file etc pam.d samba
  49. Jika semua konfigurasi LDAP dan samba sudah benar. Maka lakukan uji coba pada system LDAP Samba PDC yang telah kita konfigurasi tersebut dengan cara membuat user baru untuk samba ldap cient yang akan kita konfigurasi pada PC Client nantinya dengan mengetikkan perintah : smldap-useradd -a -m 'nofriandi'

    Kemudian berikan password untuk user tersebut dengan mengetikkan perintah :

    smbldap-passwd nofriandi

    Lalu isikan password sesuai keinginan anda, seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  50. Melakukan pengecekkan user samba-ldap yang telah kita buat sebelumnya dengan cara mengetikkan perintah : ldapsearch -b "ou=People,dc=acenk90,dc=local" -x  "(uid=nofriandi)"

    Pada terminal linux CentOS server anda, jika success maka akan tampil seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  51. Pengecekkan user samba ldap juga dapat dilakukan dengan mengetikkan perintah : id nofriandi

    Jika pembuatan account client untuk samba ldap success pada terminal linux maka akan tampil seperti gambar berikut.

    Apa fungsi konfigurasi file etc pam.d samba

  52. Melakukan pengujian join domain terhadap domain ACENK90 yang telah kita configurasi pada Samba LDAP PDC di PC Client. Langkah pertama yang harus dilakukan adalah pengaturan IP Address pada PC Client dan setting WINS nya mengarah ke IP Address LDAP Samba PDC server yang telah kita konfigurasi sebelumnya pada linux CentOS server seperti gambar berikut.
    Apa fungsi konfigurasi file etc pam.d samba
  53. Selanjutnya rubah Computer name pada PC client menjadi nama user yang telah kita create pada LDAP Samba PDC di linux CentOS server tadi, seperti gambar berikut ini.
    Apa fungsi konfigurasi file etc pam.d samba
  54. Restart PC Client untuk menerapkan perubahan seperti gambar berikut.
    Apa fungsi konfigurasi file etc pam.d samba
  55. Setelah itu lakukan join domain ke domain ACENK90 dan masukkan username dan password samba LDAP yang telah kita configure tadi. Untuk percobaan kali ini kita manggunakan samba-ldap password username "root" dan password "12345"  dan click "OK" seperti yang kita gambar di bawah ini.
    Apa fungsi konfigurasi file etc pam.d samba
  56. Jika semua konfigurasi yang anda lakukan benar maka komputer Client akan sukses tergabung kedalam domain ACENK90 seperti gambar di bawah ini. Jika tidak sukses berarti ada step konfigurasi yang salah, maka ulangi konfigurasi dari awal.
    Apa fungsi konfigurasi file etc pam.d samba
  57. Setelah join Domain ke ACENK90 success, maka PC Client akan diminta untuk melakukan restart agar menerapkan konfigurasi baru yang sesuai dengan konfigurasi  LDAP Samba PDC domain ACENK90  tersebut, kemduian click "OK". Lebih jelasnya dapat dilihat pada gambar berikut.
    Apa fungsi konfigurasi file etc pam.d samba
  58. Setelah PC Client restart, maka konfigurasi client "nofriandi" yang telah kita buat pada LDAP samba PDC melalui terminal linux CentOS server tadi dapat diterapkankan pada PC Client ini, seperti pada gambar berikut terdapat pilihan domain "log on to". Pilihlah "ACENK90" kemudian masukkan username "nofriandi" dan passwordnya sesuai.
    Apa fungsi konfigurasi file etc pam.d samba
  59. Berikut tampilan PC Client yang success login sebagai LDAP samba PDC Client yang sudah tergabung kedalam domain "ACENK90", dengan menggunakan username "nofriandi" dan password yang sesuai berdasarkan password user yang telah kita seting sebelumnya.
    Apa fungsi konfigurasi file etc pam.d samba
  60. Jika hasil settingan netlogon yang kita setting sebelumnya success. Maka folder sharing yang kita setting pada pengaturan samba akan termount/termapping otomatis saat user login, seperti tampilan gambar berikut ini.
    Apa fungsi konfigurasi file etc pam.d samba

Demikianlah pembahasan kali ini mengenai cara "Konfigurasi LDAP + Samba PDC menggunakan Linux CentOS 5.7". Untuk pembahasan lainnya akan kita bahas pada artikel selanjutnya. Semoga artikel kali ini bermanfaat bagi anda yang membacanya.