Dalam tulisan ini akan dibahas tentang instalasi dan konfigurasi samba server di Fedora 10.
Kerangkan tulisan ini adalah sebagai berikut :
1. Instalasi Samba Server
2. Konfigurasi Samba Server
3. Seting user , group , dan hak akses ke folder
4. Mengoperasikan samba server
Instalasi Samba Server
Untuk instalasi samba kita gunakan yum dengan perintah sbb berikut :
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# yum install samba
Konfigurasi Samba Server
Saat instalasi sudah berhasil, di sistem Fedora sudah memberi setingan default samba server.
Untuk memulai atau merubah konfigurasi silahkan edit file konfigurasi di /etc/samba/smb.conf
Berikut contoh konfigurasi samba server
#Global Setting, bisa kita gunakan seting default atau merubah seperti berikut
[global]
name resolve order = wins bcast hosts
passwd chat debug = Yes
add group script = /usr/sbin/groupadd %g
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/usermod -G %g %u
null passwords = Yes
username map = /etc/samba/smbusers
passdb backend = tdbsam
passwd program = /usr/bin/passwd %u
wins support = true
netbios name = FILESERVER
server string = Samba Server
unix password sync = Yes
os level = 20
add user script = /usr/sbin/useradd -m %u
add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u
delete user script = /usr/sbin/userdel -r %u
log level = 3
#Setting Share Folder
# Homes, merupakan setting sharing directory masing - masing user, ketika user login akan menampilkan folder home masing-masing
[homes]
comment = Home
valid users = %S
readonly = no
browsable = no
# Setting folder lain
[Sharing1]
path = /share/sharing1
valid users = @sharing1 # valid user yang boleh mengakses yaitu group users
force group = sharing1
read only = No
create mask = 0777
force create mode = 0777
directory mask = 0777
force directory mode = 0777
[software]
comment = Software
path = /share/software
valid users = @allstaff
force group = allstaff
read only = No
Dari konfigurasi diatas ada tambahan 2 folder sharing selain folder home, yaitu software dan sharing1. Folder sharing1 hanya valid diakses oleh user yang masuk dalam group sharing dan folder software hanya valid diakses oleh user yang masuk dalam group allstaf
Seting user , group , dan hak akses ke folders
Sebelumnya kita perlu menambahkan user dan group di sistem kita, dalam contoh ini kita akan menambahkan user bayu serta group sharing1 dan software. serta kita akan menambahkan password untuk akses ke samba berikut langkah-langkahnya
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# useradd bayu
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~ /]# passwd bayu
Changing password for user bayu.
New UNIX password:
Retype new UNIX password:
Selanjutnya kita tambahkan password untuk akses ke samba
[root@sbyoffice /]# smbpasswd -a bayu
New SMB password:
Retype new SMB password:
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# groupadd sharing1
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# groupadd allstaff
Menambahkan user bayu ke group software dan sharing1
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# usermod -G allstaff bayu
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# usermod -G sharing1 bayu
Selanjutnya kita akan membuat folder software dan sharing1
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# mkdir -p /share/software
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# mkdir -p /share/sharing1
Merubah kepemilikan folder dan hak akses folder
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# chown root.allstaf -R /share/software
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# chown root.sharing1 -R /share/sharing1
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# chmod 770 -R /share/software
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# chmod 770 -R /share/sharing1
Mengoperasikan samba server
Setelah semua selesai kita akan jalankan service smb dan winbind dengan cara sebagai berikut
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# /etc/init.d/smb start
[ This e-mail address is being protected from spambots. You need JavaScript enabled to view it ~]# /etc/init.d/winbind start
Dan untuk menjalankan smb dan winbind saat komputer restart ketikkan command sebagai berikut :
[root@sbyoffice /]# chkconfig --levels 235 smb on
[root@sbyoffice /]# chkconfig --levels 235 winbind on