With the recent stable release of Samba 4,
it is possible to create a compatible Active Directory Domain
Controller that runs on the Linux platform. Samba 4 has been in beta for
years now, but with the stable release as of December 11, 2012 you
should now have a compelling argument for implementing Samba into your
enterprise IT network. Samba 4 is a complete re-working of the Samba
code and to sum it up best is to simply quote from the Samba 4 website:
“Samba 4 is available for download via the Samba Website or from the Git repository.
In short, you can join a Windows (all recent releases should be
supported) machine to a Samba 4 domain, and it will behave much as it
does in AD, including Kerberos domain logins where applicable. The
official press release can be found on the Samba website.”
The Setup
For detailed information of configuring and setup of Samba 4 it is best to refer to the Samba4 HOWTO.
The following is how to setup and
configure a basic Samba 4 domain controller running on CentOS 6.3 or
6.4. Once configured and installed, you can then administer Active
Directory using Microsoft's Remote Server Administration Tools from a Windows XP, Vista, or 7 client that supports Active Directory. Note: your Windows client must be a Professional, Business or Ultimate edition.
This howto assumes you have the following:
-
functioning basic server running CentOS 6.3 or 6.4 x86_64 with root access
-
your CentOS server is using an IP address of 192.168.0.2 (change to your liking)
-
FQDN of 'samba.mydomain.com' (change to your liking)
-
default gateway IP address: 192.168.0.1 (change to your network gateway)
-
a Windows XP, Vista or 7 client that supports Active Directory
-
disabled SELinux (disabled to reduce complications)
-
DNS forwarding IP address using OpenDNS: 208.67.222.222 (change to you liking)
Download and Installation
NOTE:
All commands here are run as 'root' user. You do not need to be root
for all commands (which is recommended) but for simplicity sake root
will be used here to eliminate confusion.
1. Login as root and update your server
# yum update
2. Install the following packages required for installing and building Samba 4:
# yum install glibc glibc-devel gcc python* libacl-devel krb5-workstation krb5-libs pam_krb5
3. Query your rpm database to find any instances of older samba packages:
# rpm -qa | grep samba
4. If there are any older samba packages remove them with YUM:
# yum remove samba-winbind-client samba-common samba-client
5. Install git to dowload the latest Samba 4 version:
# yum install git-core
6. Use a directory of your choice and download the latest version of samba from git:
# git clone git://git.samba.org/samba.git samba-master
7. Reboot the server as a precaution so that all packages or kernel updates will be applied:
# shutdown -r now
8. Login again as root and then build samba:
# cd samba-master # ./configure --enable-debug --enable-selftest # make
9. If everything reports okay you can then install samba:
# make install
You should now have samba installed to '/usr/local/samba'.
Provision Samba 4
The provision step sets up a basic user database, and is used when you are setting up your Samba4 server in its own domain.
As root issue this command:
# /usr/local/samba/bin/samba-tool domain provision
The 'domain provision' tool should pick defaults for you automatically. Change to your configurations if necessary:
Realm [MYDOMAIN.COM]: Domain [MYDOMAIN]: (press Enter) Server Role (dc, member, standalone) [dc]: (press Enter) DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]: (press Enter) DNS forwarder IP address (write 'none' to disable forwarding) [192.168.0.1]: 208.67.222.222 Administrator password: <your_secret_admin_password> Retype password:
If above was successful, stdout should look similar to this:
Creating CN=MicrosoftDNS,CN=System,DC=mydomain,DC=com Creating DomainDnsZones and ForestDnsZones partitions Populating DomainDnsZones and ForestDnsZones partitions Setting up sam.ldb rootDSE marking as synchronized Fixing provision GUIDs A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf Once the above files are installed, your Samba4 server will be ready to use Server Role: active directory domain controller Hostname: samba NetBIOS Domain: MYDOMAIN DNS Domain: mydomain.com DOMAIN SID: S-1-5-xx-xxxxxxxxxx-xxxxxxxxx-xxxxxxxxxx
NOTE:
You may need to remove the '/usr/local/samba/etc/smb.conf' file if you
are re-running the provision command. If you encounter any errors when
running the provision command, you may need to install the necessary
missing packages or fix errors and then run './configure', 'make' and
'make install' commands again as stated above. Remember to do a 'make
clean' in the root of your 'samba-master' directory before running
'make' again.
If the provision setup was successful reboot the server:
# shutdown -r now
Start Samba 4 AD DC
Start the samba daemon:
# /usr/local/samba/sbin/samba
If you would like Samba to start at boot, append the following to your '/etc/rc.d/rc.local' file:
/usr/local/samba/sbin/samba
Testing Samba as an Active Directory DC
Verify you are indeed running the correct
version of Samba. Your version should start with version 4 (note: samba
daemon must be running):
# /usr/local/samba/sbin/samba -V Version 4.1.0pre1-GIT-c1fb37d
Verify you are running the correct samba-client version:
# /usr/local/samba/bin/smbclient --version Version 4.1.0pre1-GIT-c1fb37d
Now run this command to list the shares on your Samba4 server:
# /usr/local/samba/bin/smbclient -L localhost -U% Domain=[MYDOMAIN] OS=[Unix] Server=[Samba 4.1.0pre1-GIT-c1fb37d] Sharename Type Comment --------- ---- ------- netlogon Disk sysvol Disk IPC$ IPC IPC Service (Samba 4.1.0pre1-GIT-c1fb37d) Domain=[MYDOMAIN] OS=[Unix] Server=[Samba 4.1.0pre1-GIT-c1fb37d] Server Comment --------- ------- Workgroup Master --------- -------
Configure DNS
You will need to edit your
'/etc/resolv.conf' and '/etc/sysconfig/network-scripts/ifcfg-eth0' file
so that Samba will use it's internal DNS correctly. If you specified a
forwarding DNS server when you provisioned earlier, DNS should work
correctly (you can verify this in /usr/local/samba/etc/smb.conf). Here
is an example of my current '/usr/local/samba/etc/smb.conf' file:
# cat /usr/local/samba/etc/smb.conf # Global parameters [global] workgroup = MYDOMAIN realm = MYDOMAIN.COM netbios name = SAMBA server role = active directory domain controller dns forwarder = 208.67.222.222 [netlogon] path = /usr/local/samba/var/locks/sysvol/mydomain.com/scripts read only = No [sysvol] path = /usr/local/samba/var/locks/sysvol read only = No
Edit your '/etc/resolv.conf' file to look like this:
# Generated by NetworkManager domain mydomain.com nameserver 192.168.0.2
Next you need
to edit '/etc/sysconfig/network-scripts/ifcfg-eth0' so DNS is changed
here also. It should look something like this:
DEVICE="eth0" BOOTPROTO="none" DEFROUTE="yes" DNS1="192.168.0.2" #MUST CHANGE THIS TO YOUR HOST IP ADDRESS!! GATEWAY="192.168.0.1" HWADDR="86:C4:C1:0D:29:AD" IPADDR="192.168.0.2" IPV4_FAILURE_FATAL="yes" IPV6INIT="no" NAME="System eth0" NM_CONTROLLED="yes" ONBOOT="yes" PREFIX="24" TYPE="Ethernet"
Reboot the server for all network changes and DNS to take effect.
Testing DNS
Make sure that samba is running and then
test to make sure that DNS is working properly. Run the following
commands and compare the output to what is shown:
# host -t SRV _ldap._tcp.mydomain.com. _ldap._tcp.mydomain.com has SRV record 0 100 389 samba.mydomain.com. # host -t SRV _kerberos._udp.mydomain.com. _kerberos._udp.mydomain.com has SRV record 0 100 88 samba.mydomain.com. # host -t A samba.mydomain.com. samba.mydomain.com has address 192.168.0.2
The
answers you get should be similar to the ones above (adjusted for your
DNS domain name and hostname). If you get any errors, carefully check
your system logs and your '/etc/resolv.conf' and
'/etc/sysconfig/network-scripts/ifcfg-eth0' files.
Disable Firewall (Optional)
To reduce the chances of problems you can
completely disable the firewall on the Samba 4 server. Once you have
successfully joined a Windows client to the domain you could then
re-enable the firewall and configure IP Tables correctly.
To use the menu-based firewall utility, install this package:
# yum install system-config-firewallThen issue this command for the menu-based firewall configuration:
# /usr/bin/system-config-firewall-tuiDisable the firewall and then reboot the server.
Configure Kerberos
In CentOS 6.3 or 6.4, kerberos is handled
by the '/etc/krb5.conf' file. Make a backup copy of this original file,
and then replace the existing file, if any, with the sample from
/usr/local/samba/share/setup/krb5.conf.
# cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf
Edit
the file and replace ${REALM} with the value you chose for the
'--realm' parameter of the provision command earlier, make sure to enter
the realm in uppercase letters. It should look something like this:
# cat /etc/krb5.conf [libdefaults] default_realm = MYDOMAIN.COM dns_lookup_realm = false dns_lookup_kdc = true
Testing Kerberos
The simplest test is to use the 'kinit' command as follows:
# kinit administrator@MYDOMAIN.COM Password for administrator@MYDOMAIN.COM: Warning: Your password will expire in 41 days on Sun Feb 3 14:21:51 2013
NOTE: You must specify your domain realm MYDOMAIN.COM in uppercase letters!!
'kinit' will not give you any output. To verify that Kerberos is working, and that you received a ticket, run the following:
# klist Ticket cache: FILE:/tmp/krb5cc_0 Default principal: administrator@MYDOMAIN.COM Valid starting Expires Service principal 12/23/12 15:39:28 12/24/12 01:39:28 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM renew until 12/24/12 15:39:19
NTP (Network Time Protocol)
Make sure that 'ntpd' is running and installed. If 'ntpd' is not installed you can install it with YUM:
# yum install ntp
Enable ntpd:
# /etc/init.d/ntpd start
Also, use the 'chkconfig' command to have ntpd run at boot:
# chkconfig ntpd on
NOTE:
CORRECT TIME IS IMPORTANT FOR KERBEROS TO FUNCTION CORRECTLY. MAKE SURE
NTPD IS RUNNING ON THE SAMBA SERVER AND THAT YOU SET THE WINDOWS CLIENT
TO THE MOST ACCURATE TIME POSSIBLE! THE WINDOWS CLIENT TIME SHOULD BE
SET TO THE EXACT TIME OF THE SAMBA 4 SERVER WITHIN A FEW SECONDS IF
POSSIBLE.
Configure Windows Client to Join Domain
The following will describe how to add a
Windows 7 client to the samba DC. For other versions of Windows the same
principle should be the same.
To simplify and to limit errors with DHCP,
we will assign a static IP address to our Windows 7 client NIC.
Configure your network device as follows:
Click 'OK' to save the changes.
Now bring up a command prompt in windows and ping the Samba DC:
ping 192.168.0.2
Verify that DNS is working correctly by pinging the FQDN:
ping samba.mydomain.com
If you get replies from both then
this is a good sign and should mean that your Samba DC is functional.
Also, you may need to reboot Windows for network settings to take
effect.
Configure Date, Time and Time Zone on Windows Client
Active Directory uses Kerberos as the
backend for authentication. Kerberos requires that the system clocks on
the client and server be synchronized to within a few seconds of each
other. If they are not synchronized, then authentication will fail for
apparently no reason. Adjust your date, time and time zone accordingly
on your Windows client to match your Samba 4 server.
Join Windows 7 Client to the Domain
1. Right-click 'My Computer' icon and choose 'Properties'
2. From the left-side pane click 'Advanced system settings'
3. Choose the 'Computer Name' tab and click 'Change...'
4. Select option 'Domain', and insert MYDOMAIN.COM. If this fails just try MYDOMAIN.
5. When it requests a username and
password, type 'Administrator' as the username and then enter your
password. (password = the password you used when you ran the 'samba-tool
domain provision' command)
6. You should get a message box stating 'Welcome to the MYDOMAIN.COM domain'
7. Click OK on this message box and the Properties window, and you will then be instructed to restart your computer.
8. After restarting you should be presented with the normal login dialog. Click on 'Switch User' button.
9. Choose 'Other user' and then enter in the following:
Press 'Enter' or the arrow button.
10. You should then authenticate and then login to Windows.
Install Windows Remote Administration Tools
To install the GUI tools to manage the
domain you must install the Remote Server Administration Tools. This
will allow you easily manage the domain using Active Directory.
Windows 7
1. Download the Windows Remote Server Administration Tools
2. Follow the 'Install RSAT' instructions
3. Enable the necessary components in
'Control Panel -> Programs -> Turn Windows features on or off
-> Remote Server Administration Tools'
4. You may need to add the Administrative
Tools to your start menu. Right-click 'Start button' and select
'Properties -> Start Menu tab - Customize... -> System
administrative tools - Display on the All Programs menu'
Managing Samba 4 AD DC from Windows 7 Client
This is beyond the scope of this article. For further information please refer to the Samba4 HOWTO
Configure the Firewall
Once you have been able to successfully
have your windows clients attach to your Samba 4 DC, it is prudent to
renable the firewall on your CentOS 6.3 Samba 4 DC. Simply run the
firewall command again:
# /usr/bin/system-config-firewall-tui
Configure the firewall to have AT LEAST these ports open:
53, TCP & UDP (DNS)
88, TCP & UDP (Kerberos authentication)
135, TCP (MS RPC)
137, UDP (NetBIOS name service)
138, UDP (NetBIOS datagram service)
139, TCP (NetBIOS session service)
389, TCP & UDP (LDAP)
445, TCP (MS-DS AD)
464, TCP & UDP (Kerberos change/set password)
1024, TCP (AD?)
For RSAT tools and extras other ports may need to be opened. Microsoft has a list of the port required which you can find here: http://technet.microsoft.com/en-us/library/dd772723%28WS.10%29.aspx
ReplyDeleteThat is very interesting; you are a very skilled blogger. I have shared your website in my social networks..!
Online Reputation Management
View here http://topspying.com/ikeymonitor/ best keylogging and hacking software related articles.
ReplyDeleteitmeets.guru is a search engine for hackathons. It's a place for hackers, Gamers, developers to discover and share the latest hackathons, Upcoming Gaming Events in 2017, Hacking Conference in India,cyber security conferences around the world, Developer Conference,Events in USA, cyber security conferences, infosec summit, gaming events, global seminars, networking meets and workshops, i7m33ts,IT Events, Capture the Flag, Call For Paper's,Seminars,Workshops, CTF2017 , Call For Hackers
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThe blog is very different and useful. The way of writing makes it more interesting.
ReplyDeleteBIGDATA Training in Chennai
Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
ReplyDeleteonline Python training
python training in chennai
Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
ReplyDeleteJava interview questions and answers
Core Java interview questions and answers
Java training in Chennai | Java training in Tambaram
Java training in Chennai | Java training in Velachery
I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
ReplyDeleteData Science training in Chennai | Data Science Training Institute in Chennai
Data science training in Bangalore | Data Science Training institute in Bangalore
Data science training in pune | Data Science training institute in Pune
Data science online training | online Data Science certification Training-Gangboard
Data Science Interview questions and answers
Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts
ReplyDeleteangularjs Training in bangalore
angularjs Training in btm
angularjs Training in electronic-city
angularjs online Training
angularjs Training in marathahalli
angularjs interview questions and answers
Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
ReplyDeleterpa training in bangalore
best rpa training in bangalore
rpa training in pune
rpa online training
I gathered lots of information from your blog and it helped me a lot. Keep posting more.
ReplyDeleteData Analytics Courses in Chennai
Big Data Analytics Courses in Chennai
DevOps course in Chennai
Best DevOps Training in Chennai
Amazon web services Training in Chennai
AWS Certification in Chennai
Data Science Training in Anna Nagar
Data Science Training in T Nagar
i was fully study this article and get more ideas from this article and in this article i know what to do to improve my skills..really thanks for the information.
ReplyDeleteMachine Learning Course in Chennai
Machine Learning Training in Chennai
DevOps certification in Chennai
🏵PLUG HACKERS🏵
ReplyDeleteWe are a group of HACKERS dedicated to fish out SPAMMERS❌( fake Hackers) that are stealing from people daily. The are everywhere in the internet, in various Sites and Social Media.
WHO ARE PLUG HACKERS⁉️
We are HACKERS registered under the HACKER’s FORUM “HACKERONE”. We have dedicated ourselves to flush out these false HACKERS and also to help their victims recover Every penny💵💶 they have lost to this Thieves.
If you have been a victim of this SPAMMERS you need to contact us ASAP using the Email provided below
GLOBALPLUGGERS@gmail.com
OR
You can drop a voice note message to the secure line below and we will get back to you
+1 (808) 600 0773.
Are you following by error to deal with Gemini issues? Most of the times it happens when users are unable to send digital currency to another wallet and experience trouble. If you are unable to deal with this error and you are looking for solution to deal with it, feel free to speak to the experts and avail Gemini Support Number solutions related to queries. All you have to do is call on Gemini support number which is functional all the time and the experts can speak to the team anytime for better results.
ReplyDeleteAs the growth of Google cloud big data services , it is essential to spread knowledge in people. This meetup will work as a burst of awareness.
ReplyDeleteBlockchain two-factor Blockchain customer care +1 (855) 942-0545 UNITED STATES authentication is the element that helps in keeping your Blockchain account safe and secure. To handle all worries related to Blockchain 2fa , you should directly get in touch with the team of elite Blockchain Customer Service Number professionals who are there to guide you. You can always call on Blockchain customer care number which is always functional. The team is ready to guide you in every possible manner. You just have to reach them to deal with all troubles in one go.
ReplyDeleteAre you coming across 18778462817 errors while withdrawing the funds from the MyEtherWallet ? MyEtherWallet has user-friendly interface but some users because of less knowledge get stuck in such issues. If you’re one of such users and looking for guidance to handle all troubles all at one place under the assistance of experts, you can always have conversation with the team via calling on MyEtherWallet customer care number which is MyEtherWallet Customer Service Number working all the time globally and users from any part of the nation can contact them and discuss their queries immediately.
ReplyDeleteAre you surrounded by troubles 18778462817 at the time of opening and working on the Binance exchange? Errors like login issues, sign up issues, password issues come across the path of many users and in order to deal with them, one need guidance from the experienced experts who are there to handle Binance Customer Service Number all your worries. You can always call on Binance customer care number which is functional and the team is ready to assist you at every step. You can connect with the team anytime for availing results that are easy to execute.
ReplyDeleteIn Ledger Nano S. Sometimes Bitcoin Transactions Become Difficult
ReplyDeleteLedger Nano S. platform provides a platform where users can trade multiple coins like Bitcoin. Bitcoin got the popularity since its inception and when users face difficulty in making bitcoin transactions , it is advised to gain solutions from the skilled professionals who are there to help you. You can always call on Ledger Nano S. support number which is always active and the team is ready to assist you at every step. You can always connect with the team when you need guidance and speak to the team to avail productive results which are easy to execute. For more details visit https://www.cryptophonesupport.com/wallet/ledger/ or call us 1-877-846-2817.
Do you need Personal Finance?
ReplyDeleteBusiness Cash Finance?
Unsecured Finance
Fast and Simple Finance?
Quick Application Process?
Finance. Services Rendered include,
*Debt Consolidation Finance
*Business Finance Services
*Personal Finance services Help
contact us today and get the best lending service
personal cash business cash just email us below
Contact Us: financialserviceoffer876@gmail.com
call or add us on what's app +918929509036
Hi Guy's
ReplyDeleteFresh & valid spammed USA SSN+Dob Leads with DL available in bulk.
>>1$ each SSN+DOB
>>2$ each with SSN+DOB+DL
>>5$ each for premium (also included relative info)
Prices are negotiable in bulk order
Serious buyer contact me no time wasters please
Bulk order will be preferable
CONTACT
Telegram > @leadsupplier
ICQ > 752822040
Email > leads.sellers1212@gmail.com
OTHER STUFF YOU CAN GET
SSN+DOB Fullz
CC's with CVV's (vbv & non-vbv)
USA Photo ID'S (Front & back)
All type of tutorials available
(Carding, spamming, hacking, scam page, Cash outs, dumps cash outs)
SMTP Linux Root
DUMPS with pins track 1 and 2
Socks, rdp's, vpn's
Server I.P's
HQ Emails with passwords
Looking for long term business
For trust full vendor, feel free to contact
CONTACT
Telegram > @leadsupplier
ICQ > 752822040
Email > leads.sellers1212@gmail.com
**HACKING TOOLS WITH TUTORIALS & FULLZ AVAILABLE**
ReplyDelete(High Quality, Genuine Seller)
=>Contact 24/7<=
Telegram> @leadsupplier
ICQ> 752822040
Email> exploit.tools4u@gmail.com
Fullz info included
NAME+SSN+DOB+DL+DL-STATE+ADDRESS
Employee & Bank details included
High credit fullz with DL 700+
(bulk order negotiable)
**Payment in all crypto currencies will be accepted**
->You can buy few for testing
->Invalid or wrong info will be replaced
->Serious buyers needed for long term
TOOLS & TUTORIALS AVAILABLE FOR:
"SPAMMING" "HACKING" "CARDING" "CASH OUT"
"KALI LINUX" "BLOCKCHAIN BLUE PRINTS"
**TOOLS & TUTORIALS LIST**
->Ethical Hacking Tools & Tutorials
->Kali Linux
->Keylogger & Keystroke Logger
->Facebook & Google Hacking
->Bitcoin Flasher
->SQL Injector
->Paypal Logins
->Bitcoin Cracker
->SMTP Linux Root
->DUMPS with pins track 1 and 2
->SMTP's, Safe Socks, Rdp's brute, VPN
->Php mailer
->SMS Sender & Email Blaster
->Cpanel
->Server I.P's & Proxies
->Viruses
->Premium Accounts (netflix cracker, paypal logins, pornhub, amazon)
->HQ Email Combo
If you are searching for a valid vendor, it's very prime chance.
You'll never be disappointed.
**You should try at least once**
Telegram> @leadsupplier
ICQ> 752822040
Email> exploit.tools4u@gmail.com
**HACKING TOOLS WITH TUTORIALS & FULLZ AVAILABLE**
ReplyDelete(High Quality, Genuine Seller)
=>Contact 24/7<=
Telegram> @leadsupplier
ICQ> 752822040
Email> exploit.tools4u@gmail.com
Fullz info included
NAME+SSN+DOB+DL+DL-STATE+ADDRESS
Employee & Bank details included
High credit fullz with DL 700+
(bulk order negotiable)
**Payment in all crypto currencies will be accepted**
->You can buy few for testing
->Invalid or wrong info will be replaced
->Serious buyers needed for long term
TOOLS & TUTORIALS AVAILABLE FOR:
"SPAMMING" "HACKING" "CARDING" "CASH OUT"
"KALI LINUX" "BLOCKCHAIN BLUE PRINTS"
**TOOLS & TUTORIALS LIST**
->Ethical Hacking Tools & Tutorials
->Kali Linux
->Keylogger & Keystroke Logger
->Facebook & Google Hacking
->Bitcoin Flasher
->SQL Injector
->Paypal Logins
->Bitcoin Cracker
->SMTP Linux Root
->DUMPS with pins track 1 and 2
->SMTP's, Safe Socks, Rdp's brute, VPN
->Php mailer
->SMS Sender & Email Blaster
->Cpanel
->Server I.P's & Proxies
->Viruses
->Premium Accounts (netflix cracker, paypal logins, pornhub, amazon)
->HQ Email Combo
If you are searching for a valid vendor, it's very prime chance.
You'll never be disappointed.
**You should try at least once**
Telegram> @leadsupplier
ICQ> 752822040
Email> exploit.tools4u@gmail.com
Dazzling as studying Data Science Training in Chennai with extraordinary practical experience at Infycle Technologies, the major software training institute in Chennai. And we also come up with more courses like Blockchain, Full Stack Developer, AI & ML, and Data Science with real-time practical experience in the Industry. To know a lot, approach us on 7504633633 or 7502633633.
ReplyDelete