Skip to main content

Konfigurasi samba PDC another way with bash script

Base on
Conversation with xxxxxxxxxxxx at 5/26/2009 8:42:09 AM on xxxx (yahoo)
(5/25/2009 8:20:26 PM)xxxxxx: kirimin ke emailku perbedaan jaringan di linux dan windows, trus kenapa jaringan lebih baik kalau di linux? tak tunggu yah. pake notepad aeee OKEH. sisan tutorial samba sebagai PDC okeh (domain controler) matursuwun [ minimal dua user ajah di sambanya ]

Dari permintaan seorang teman aku akhirnya nulis lagi sekalian tuk menuhin blog gitu.. juga nostalgia dengan bash script. :D dah hampir lupa soale. maklum pake W******* teyusss.. heehhe

so.... pembahasan akan mencakup tentan PDC dengan samba ...( jadi inget waktu kuliah )..
lets begin

Dengan Script bash
1. Siapkan peralatan tempur
2. Samba ready :D silahkan di install dulu samba, samba-common, samba-client
3. Karena script menggunakan dialog, install terlebih dahulu pakage : dialog (1.1-20071028-3)
4. Download script nya disini http://www.ziddu.com/download/4906070/samba_pdc.rar.html
5. Extrak samba_pdc.rar
6. Kasih permisi execusi pada file samba_pdc.sh :

chmood +x samba_pdc.sh

7. Jalankan script

./samba_pdc.sh

8. Ikuti petunjuk yang ada discript
9. Semoga berhasil, akibat dari script adalah tanggungan sendiri- sendiri.
10. Jika script eror kasih comment ya hehehehehe:D . Maklum masih belajar.....
see:


Manual
1. samba ready :D silahkan di install dulu samba, samba-common, samba-client

2. Konfigurasi /etc/samba/smb.conf sebagai berikut :

[global]
workgroup = brekele.inc --> ubah sesuai yang kita mau
netbios name = brekele.inc --> ubah sesuai yang kita mau
server string = Open Source --> ubah sesuain yang kita mau
passdb backend = tdbsam
security = user
username map = /etc/samba/smbusers
name resolve order = wins bcast hosts
domain logons = yes
preferred master = yes
wins support = yes

# Useradd scripts
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/usermod -G %g %u
add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u
idmap uid = 15000-20000
idmap gid = 15000-20000

# sync smb passwords woth linux passwords
passwd program = /usr/bin/passwd %u
passwd chat = *EntersnewsUNIXspassword:* %n
*RetypesnewsUNIXspassword:* %n
passwd chat debug = yes
unix password sync = yes

# set the loglevel
log level = 3

[homes]
comment = Home
valid users = %S
read only = no
browsable = no

[netlogon]
comment = Network Logon Service
path = /home/samba/netlogon
admin users = Administrator
valid users = %U
read only = no

[profile]
comment = User profiles
path = /home/samba/profiles
valid users = %U
create mode = 0600
directory mode = 0700
writable = yes
browsable = no


3. Buat beberapa direktori berikut sebagai domain logon dan profile :

mkdir /home/samba
mkdir /home/samba/netlogon
mkdir /home/samba/profiles
mkdir /var/spool/samba
chmod 777 /var/spool/samba/
chown -R root:users /home/samba/
chmod -R 771 /home/samba/

4. Lalu restart samba

/etc/init.d/samba restart

5. Ubah pada bagian /etc/nsswitch.conf, pada baris :

hosts: files dns
menjadi :
hosts: files wins dns

6. tambahkan beberapa pc client pada /etc/hosts :

127.0.0.1 localhost
***.***.***.*** client1
***.***.***.*** client2


7. Tambahkan user root kedalam user samba :

smbpasswd -a root
New SMB password:
Retype new SMB password:

8. buat file /etc/samba/smbusers lalu jalankan :

echo "root = Administrator" > /etc/samba/smbusers


mengartikan bahwa user root = user administrator pada windows

9. Silahkan test settingan dengan :

smbclient -L localhost -U%

kalo gak ada eror berarti jalan :D


10. lalu setup domain group untuk windows :

net groupmap add ntgroup="Domain Admins" unixgroup=root
net groupmap add ntgroup="Domain Users" unixgroup=users
net groupmap add ntgroup="Domain Guests" unixgroup=nogroup


nb jika groupmap telah dibuat add diganti dengan modify atau lihat man page

11. tambah user linux dan user samba dengan cara :
user linux :

useradd singo -m -G users

user samba :

smbpasswd -a singo #singo=sesuai selera


12. Sekarang tambahan direktori share yang akan dipakai oleh seluruh user :

mkdir -p /home/shares/allusers
chown -R root:users /home/shares/allusers/
chmod -R ug+rwx,o+rx-w /home/shares/allusers/


13. Ubah juga pada /etc/samba/smb.conf, tambahkan baris berikut :

[allusers]
comment = All Users
path = /home/shares/allusers
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes


14. lalu restart samba kembali :

/etc/init.d/samba restart

15. Langkah terakhir join kan kompy windows ke PDC linux , dengan cara :
- Klik kanan pada My Computer
- Pilih Computer Name - Change
- Masukan domain PDC pada bagian domain
- Akan muncul windows yang meminta memasukan user dan password, pada langkah ini masukan user root dan password samba untuk user root
- Klik OK
- Akan muncul bahwa kita sukses menjoinkan mesin windows ke PDC linux

thank's

referensi :
http://ubuntulinux.or.id/blog/2006/10/06/konfigurasi-samba-sebagai-pdc-di-ubuntu-server

Comments

Popular posts from this blog

Webalizer - Statistik trafik/kunjungan web (ubuntu)

--goal--
make subdomain trafik statistik

--install--
run this command :
sudo apt-get install webalizeredit "/etc/apache2/apache2.conf" , set
HostnameLookups Off into :
HostnameLookups On
--1--
All we need is already prepared, now set log of vhost in "/etc/apache2/sites-enabled" to spesifict folder.
exp. $sudo vi /etc/apache2/sites-enabled/monitor CustomLog ${APACHE_LOG_DIR}/access.log into: CustomLog ${APACHE_LOG_DIR}/vhost/monitor/access.logrestart service
$sudo /etc/init.d/apache2 restart
--2--
create another file config of webalizer in /etc/webalizer
exp. vi /etc/webalier/monitor.conf
set the LogFile to apache2 logfile:
LogFile /var/log/apache2/vhost/monitor/access.log # apache log OutputDir /var/webalizer/monitor/ #webalizer report Incremental yes ReportTitle Usage statistics for HostName monitor.brekele.co.cc
--3--
create script to run webalizer via crontab
exp. vi /etc/webalizer/cron_job
#!/bin/bash echo "di jalankan pada: `date +"%d-%B-%Y %r"…

pgpoolAdmin, web interface for pgpool

--preparation--
next capter of pgpool from my last post ( here), now i wanna post about a tool that can manage pgpool from web interface called pgpoolAdmin. next... enjoy the post... ^_^

--1--
first we need to download pgpooladmin from here, extrak and copy or move to http directory( for exp : /var/www) 
$wget http://pgfoundry.org/frs/download.php/2964/pgpoolAdmin-3.0.3.tar.gz $tar zxvf pgpoolAdmin-3.0.3.tar.gz $sudo cp -Rf pgpoolAdmin-3.0.3 /var/www/test
 --2--
install pgpooladmin via web on: http://localhost/test/install


make sure owner of that file is "www-data"(of course have write akses) and check again



login with user that you create on /etc/pcp.conf (for more detail see my last post



and done.ya.. tooo.......!!!
 ^_^

send oracle 11g audit log to syslog server ( on other PC)

--preparation-- 
well...... this time i will write about syslog, and for this experiment what we need is :
- kiwi syslog server get from here and install it on your PC( i use xp for this server syslog)
- oracle db
- and of course, a cup of coffee is a must and other thing that make you relax and comfortable ( :p )

--scema--
first thing to do is redirect oracle audit log to syslog, and than from syslog send to syslog server( kiwi syslog)

--1--
 edit initSID.ora and add this folowing config :
create "/var/log/oracle/" firs
audit_file_dest='/var/log/oracle/' audit_trail='OS' AUDIT_SYSLOG_LEVEL=local1.warning after that edit /etc/syslog.conf, and add this folowing config :
#Save oracle rdbms audit trail to oracle_audit.log local1.warning /var/log/oracle/oracle_audit.log #Send oracle rdbms audit trail to remote syslog server local1.warning @1.1.1.1 #<= ip your syslog server--2--
restart syslog service with command :
/sbin/service syslog restart …