How to Make an Ubuntu Active Directory Domain Controller With Samba
Вставка
- Опубліковано 10 вер 2024
- In this video, I will be showing you how to make an active directory domain controller using Ubuntu Server and Samba4.
Software Installation Command: sudo apt-get install git build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev libpam0g-dev ntp -y
Ubuntu: www.ubuntu.com/
Administration Tools (For Windows XP): www.microsoft.c...
Remote Server Administration Tools (For Windows Vista, 7, or 8. **BE SURE TO READ THE INSTRUCTIONS ON THE WEBSITE!**):
Vista: www.microsoft.c...
7: www.microsoft.c...
8: www.microsoft.c...
8.1: www.microsoft.c...
Website: www.goguda55tec...
Facebook: / goguda55techtutorials
Twitter: / goguda55youtube
for anybody that are having trouble with kerberos for example cannot contact kdc. you must edit the file on /etc/krb5.conf and go to realms and than edit kdc and admin_server to something like this
kdc = [hostname].[yourdomain]
admin_server = [hostname].[yourdomain]
thats all
*dont exactly copy that you know what i mean
Three years from this video tutorial and still works perfect in Ubuntu Server 16.04 LST, excellent , thanks for the contribution!
It would be great if you update this tutorial using ubuntu 18.04 and the new samba version :)
or ubuntu 20.04
Just want to let you know that you are spot on with this, Samba Domain Setup. It took me all day but when I was done and the way you explain it step y step in full detail, my server is up and running. Thank you for all that you do.
Software Installation Command: sudo apt-get install git build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev libpam0g-dev ntp -y
Had to remove libgnutls-dev but other than that everything worked perfectly. Thank you very much.
As a network engineer I highly recommend against static address. You should be reserving IP addresses in the DHCP server to the associated MAC address. This is closer to best practice.
Why?
Thank you so much for this tutorial. I had to make a school project and searched for days to fix some problems, started over from scratch while following your video and it worked perfectly. Thanks!
Ubuntu Server 14.04 x64
Samba 4.8
Windows 10 Enterprise 2016 ltsb x64
Worked perfectly, awesome tutorial!
Rather than creating a root password, I would suggest people follow the Ubuntu convention and use "sudo su" when you want a root session, rather than setting a password for root. Not that I think there's anything specifically wrong with logging on as root, but Ubuntu chose not to allow it by default and for good reason.
Also, I suggest configuring the DHCP server with reserved IPs vs setting a static IP in the server. I just find it more organized this way, but it reaaally doesn't matter :)
And not to be totally critical (I tend to do that a lot), this is a great tut! very helpful...Thank you :D
This is amazing. I have been asking this question for a long time. Now I am in a new environment, there is no budget for new servers and windows server licenses. This may be what I needed. I am a little shaky on implementing this live, as I have access to Win Server 2003 + 2008 DC's, but never on Linux. I do have Ubuntu desktop experience however, and used the terminal on it for the most part. I am going to try a small private network to test how comfortable I feel implementing this live. Thanks for this very in-depth guide. Need more guides like this on the net, no holes in this.
It's still working. Thank you for your help :)
wow worked great just done a new domain for a youth club to help maintain user accounts for diffrent events and also ages top man
This is a great tutorial. Cannot thank you enough. Up and tunning ASAP and didn't cost me anything! Thank you, thank you, tthhhhaaannkkk yoooouuuuu.
Thanks for this incredible tutorial, finally I've made it work. Only a suggestion: please put the logo in the upper corner, because it hide some parts of the commands.
Greetings!!
Thanks for this video, As I knew ZERO about linux when I decided to try this. Your tutorial helped a lot. I also gleamed some useful information from Frank's Help desk. But it was your video that encouraged me to try this out.
All that being said, I made a open office text document follow along, that I am willing to share if you would be interested. Cheers
First of all: this tutorial is awesome and it's exactly what I wanted in my network, the only critical issue is no Internet on computers that joined the domain!
Please help me with this issue
many thanks
Thank you very much for a very useful tutorial.... I have successfully setup an AD DC server...
I am getting error " Project not configured(run waf configure first)
me too
Hey awesome tutorial, all instruction were clear and well explained all my install in a live environment worked perfectly. Thanks again...
Great Tutorial!!!
I was looking Domain Controller on Raspberry Pi but i got stuck in the middle :-( Now your tutorial is very interesting
Thank you for sharing.
Thank you very much for your detailed instructions.
If i am installing samba using apt-get, do i need all of below?
git build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev libpam0g-dev ntp
If not can you specify the required ones only?
Also please specify the apt-get packages required for samba.
Thank you so much for this. Super easy and very informative !!
First and foremost, this is one of the best tutorials I've seen out there on any subject! Well explained, bro. Kudos!!
Question: I successfully got my Samba AD DC up and running but found out it could only resolve IP addresses and not names! What can I do to fix this DNS problem? I really need to have my server resolve PC names on my domain.
Thanks in advance
Excellent video.. i'll definitely try out this at my home lab. Thx a lot.
Thank you. Worked perfectly!
What are the software that you need to have? thank you for the reply/.
This is an Excellent turoial video - Thank you.
Love your tutorials! cheers mate!
Thank you very much for this tutorial!
Thanks for this man, really nice material
Thanks for this guide, it works well...
getting this error message "tree connect failed: NT_STATUS_BAD_NETWORK_NAME" after the command " /usr/local/samba/bin/smbclient //localhost/netlogon -UAdministrator%"password" -c 'ls'
Omg, this is exactly what I have been looking for! I currently use 2012 r2 essentials as a domain controller and would really like to move away from Windows wherever possible on my home network. Has anyone who tried this found it to be a viable replacement for Windows as an Active Directory environment?
I got it working and logged on to the domain as Administrator but when I try to open any of the Remote Server Administration Tools I get an error telling me I have an incorrect username or password. I've tried searching for this for about an hour and couldn't find any answers so I now post my question here. Any help would be greatly appreciated.
Any particular reason why you did not use apt-get method to install samba but instead source and make?
I was wondering the same thing ... I used apt-get and it works fine also. It's a lot easier. You don't have to type the whole path to samba, smbclient or samba-tool.
To answer your question, I compile from source in this video because the video came out before samba4 was even in the repos. You can definitely do the apt-get method now, which I agree is a lot easier! :)
Thanks for the response David!
Muralidhar Bijjur No problem!
Sorry, a real linux virgin here. I initially tried to install samba using the source/make and was unable to clone. Then I tried by "apt-get install samba -y" and it looked like it worked until I tried to provision the domain and got "bash: /usr/local/samba/bin/samba-tool: No such file or directory" Could you kindly tell me where I went wrong? Thanks so much!
im stuck after the install i get a provision error with something about smb.conf must match chosen domain
Ok, everything was great, but still, I can’t resolve the problem with startup script for samba.
I try several ways, I created the file .conf and put it in the /etc/init or /etc/init.d, but still doesn’t work. Every time when I reboot the system I need to start samba manually.
Please help.
hi,
my machine connected with wi-fi . i have to change static ip address but when i type "ifconfig" its show my ip address on wlp2s0f0 and after when i type vi /etc/network/interfaces its show only loopback don't come any option to change the ip address. Can you help me regarding this error
Amazing. This I hope this works on AWS ubuntu 18 and on windows 10. Gonna try it out.
Obrigado cara o seu tutorial foi o único que funcionou pra mim
Bem completo
Parabéns
@crystarium Fala meu amigo, não entendi muito bem a sua dúvida, mas esse tútorial serve para vc criar um controlador de domínio no linux ele vai fazer o mesmo papel do Windows Active Directory. Criar usuários dar permissões e etc
when trying to provision samba... I throw the command in there with my info (domain, password... etc.) and I get an error back "-bash: !@#: event not found" I've verified that it's in the correct directory. and no errors during the make process.
I managaed to get the domain controller installed and I can login via my windows 8 PC. I get a problem when I try to create new users via Active Directory Users and Computers. As soon as I launch the program it display an error dialog stating "Naming Information cannot be located because: The procedure number is out of range" Does anybody have any ideas how I can fix this. Thanks.
Hi David
How would the set up change if I wanted to route the servers internet connection to windows clients? so for example the primary eth connection connects to the internet and I add a secondary (eth1) for allowcating Ips to clients.
hello,
I made this video with the help of the installation. I have Windows 7 and Windows 8.1 operating systems domain member. I made the connection even with windows 2008 and windows 2012 r2.
but did not provide membership with a different ubuntu 14.04.
Can you help?
clear and excellent video tutorial,,,great!!
Hello. After server reboot domain controller isn't working. Please help me fix it.
if you get the libgnutls-dev has no candidate err, in samba's wiki says that libgnutls-dev has been replace by libgnutls28-dev on Debian >=8 and Ubuntu >=14.04
Bad news..
I can't solve this problem
after pressing enter key /usr/local/samba/bin/smbclient //localhost/netlogon -Uadministrator%JOEserver123" -c 'ls'
it says
session setup failed nt_status_logon_failure
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
When disabling the expiration of the password for the Samba account Administrator, I keep getting "set_varible(N): value is not boolean!". I tried restarting my server, and when I went to start Samba it gave me the same error message. I cannot find any help on the Ubuntu Forms either. Im using Ubuntu Server 14.04 and Samba 4.1.7 with Kerberos 5. Please help me.
i put kinit administrator@EXAMPLE.LOCAL when i put enter i see this error:
Kinit: invalit argument while getting initial credentials, How i fix that pliz help me.
sorry for my bad english
when i do /usr/loacl/samba/bin/smbclient -L localhost -U% the domain = workgroup and os=windows 6.1 any suggestion i m on virtualbox with nat network
Hello Goguda, I need help, I am using this code for installation, but it is giving error follows the error message - Package 'libgnutls-dev' has no installation candidate
So I just did the steps and the software command doesn't work, says libgnutils-dev has no installation candidate
Hi, I'm having trouble with authentication part of the samba where I typed in /usr/local/samba/bin/smbclient //localhost/netlogon -UAdministrator%"myuserpassword" -c 'ls', and I got this message that says "session setup failed: NT_STATUS_LOGON_FAILURE. I got everything right up until this authentication point. My Samba is running because when I run /usr/local/samba/sbin/samba -V, I get Version 4.3.4. I seem to have issue with the password (I think). I use the same password when I created during the Ubuntu installation. I'm using Ubuntu Server 14.04.3. Thank you very much in advance
i have this problem :(
kinit cannot resolve servers for kdc in realm"exple.com" while geting intitiat credential
This video is very detailed and I can successfully implement Samba 4 active directory in VMware workstations. Thanks to goguda55 Tech and couple of other team mates here..
i stuked on 18:05 and server displaying samaba-tool optional why is that ??
I'm getting this error. Can someone help @18.38 secs
bash: /usr/local/samba/bin/samba-tool: No such file or directory
While trying to use RSAT on Win7 I got the following message:
"Naming information cannot be located because:
Logon failure: unknown user or bad password"
I followed the steps and I can join machine to the domain but When I try to open Active Directory User and Computers I got that message. How can it be fixed.
Greetings.
GREAT TOTURIAL!!! Thanks
I have a question how to set policy in DC for Ubuntu client. Please help me
Hi, i can't add user with remore active directory.... i see list of user,list of groups but when i click on add user, never happend.. How can i resolve?
One question guys, if i have one active directory running on ws2008 can i do this steps for add it as a secondary dc??
plz i need help. im at usr/local/samba/bin/samba-too provision --realm etc @18:21...................
getting samba-tool domain: error: no such option: --realm
plz any idea thanks
Pls correct me if I am wrong, but just to be clear, THERE IS NO DOMAIN CONTROLLER IN LINUX. Windows has DC (and Novel if I do not mistake). What linux provide is a PDC and BDC. It is Primary/Backup Domain Controller. Windows moved away from that a long long time a go because it is a real pain to work with. Oc there is so many things to say about that so I will stop here but just wanted to make ppl aware of that aspect, and don't just jump on Samba and expecting a DC.
Great tutorial, thanks a lot.
How do i add network shares as i cannot do it i tried to add a folder network share called dfs but i could not see it on my win pc
ok right at 18:20 seconds on your video i type in the commands and hit enter and the responds with samba4#: command not found I have triple check the spelling
hi i have installed server as in video .but i have stuck error in middil
where i am not abel to connect to samba server error**( fatal: unable to connect to **git.samba.org**: > **git.samba.org**[0: 193.175.80.230]: errno=No route to host)** so please help me to get ride of the is error
i have set it all up today, big thanks to you for that great tutorial ;)
but i have one problem with dns. on the beginning you said that the dns-nameservers is your server and google ip as secondary. thats great so far, but after i provisioned my domain, the dns didn't worked properly (loading failures on websites).. if i change the ip to the router or just the google ip it works good. is it ok to change it like i said before, or would the domain stop working?
Edit: Ok, now it works, a simple restart solved the problem ;)
Hi, this is great I've got it running but I can't add user client for some reason I can't see my domain under Active Directory Users and Computers. When I click change domain I can see my domain but it won't let me go through I am getting error "The domain could not found because: Access is denied"
Many thanks to you from Ukraine
I followed your ubuntu file server tutorial and it worked brilliantly but I think this would complete my needs. A question if I may before I get stuck in.
if I were to set-up a domain as you have done will I have the ability to create users that can read and right to a specific file server which is also on that domain without issues. e.g. like losing the Trust relationships between computers/users and the domain meaning they wouldn't be able to read or write to the ubuntu file server? or having more than one user account in use at the same time?
i completed the video and i joined my domain controller using a windows 10 operating system but i have lost my internet connection what should i do?
I Have done all the processes given in this video without any mistake, but I am unable to join the domain in other PCs. It shows, "An Active Directory Domain Controller (AD DC) for the domain 'Domain Name' could not be connected."
Please help me.
Hay!
I've done all the configuration with samba server, and it's working perfectly. But now there is an issue that my client computers are unable to connect to the internet. I've added google dns (8.8.8.8) as secondery dns on the client machine but still it isn't resolving the domain names of websites...please help me out i am stucked on it.
Thanks
exactly same issue for me, did you find any solution ?
The ubuntu server need to have internet connection in order for your clients can access the internet, you need to configure the dns in ubuntu to forward the dns queries to 8.8.8.8, or any other public dns.
check for the default gateway it should be your internet routers ip
Everything works fine, Ive got a server into the new domain, but unfortunately have limited internet connection, is there a way to modify that? I also noticed in the video that you have limited connection,,,,, any suggestions?
Thanks for this lesson
kinit : cannot find KDC for realm "domain.com" while getting initial credentials
I have no Idea
Hello sir, could you please guide me in short words or links how to setup samba to share folders on my linux server to be accessable by windows clients (when I am using samba as a DOMAIN CONTROLLER, because I did that in the normal stand alone mode easily, but in DC mode I couldn't do that).
Thank you in advance
Everytime i put this command smbclient -L localhost U% results in error... do you know about it?
the tutorial was very clear and i have done the instillation perfectly without any problem and it was working fine but as soon as I start samba service my internet connection is going down. can you help me out.
I wonder if i can do offline installation for all these packages and put them in CD , it will be more easier to try it at work 🤔
Runs but when I set the primary DNS to the AD server I get DNS errors when connecting to the internet. When I leave it set to auto there are no problems???
If your router redirects DNS, then instead of using google DNS (8.8.8.8) in the file "/usr/local/samba/etc/smb.conf" put your default gateway.
Example:
[global]
Workgroup = yourworkgroup
Realm = bob.local
Netbios name = yourserver
Server role = active directory domain controller
DNS forwarder = [default gateway]
I updated from 16.04 to 18.04.03 before installing the above packages. When I ran the script listed above, everything worked except the libgnutls-dev package. It says the package is not available, but is referred to by another package. This may mean the package is missing, obsolete, or is available only from another source. Will it still work?
Try libgnutls28-dev
got error at kinit administrator@FITLABS.LOCAL
kinit: Cannot contact any KDC for realm 'FITLABS.LOCAL' while getting initial credentials
please help
had to edit /etc/krb5.conf and add below,
[realms]
YOURDOMAIN.LOCAL = {
kdc = hostname.domain.local
admin_server = hostname.domain.local
MVP
Great Tutorial! I have all my windows machine connected to the domain controller. However, I was trying to enable a share through the smb.conf file and the share was not visible by windows machines. Do I need to add more lines to the global section for sharing to work?
Hi!
can i see who is connected to my file share? Like smbstatus on normal samba file share server?
And why after every restart it shows:
server_name login: [7.870180] intel_rapl: no valid rapl domains found in package 0
[8.420245] intel_rapl: no valid rapl domains found in package 0
[9.969380] intel_rapl: no valid rapl domains found in package 0
[9.519032] intel_rapl: no valid rapl domains found in package 0
Thanks for the tutorial David!
I installed Samba usting apt and just ran samba-tool without the path. However I got the following error:
ERROR(): Provision failed - ProvisioningError: guess_names: 'server role=standalone server' in /etc/samba/smb.conf must match chosen server role 'active directory domain controller'! Please remove the smb.conf file and let provision generate it
As the output of the error suggests, I deleted the default smb.conf and it carried on. Result happiness!
When testing Kerberos using the kinit administrator@domain.local, instead of being asked for my password I received this message
kinit: Client 'administrator@DOMAIN.LOCAL' not found in Kerberos database while getting initial credentials
(Of course Domain.local is not my actual domain name but just as an example of the error.)
I went back through the video several times checking the changes that I have made and cannot find the problem. Anyone else have identical or similar issues that can point me in the right direction?
Hi, great Tutorial, but there is one question. I cant connect to any website by name, exp. www.google.de just over ip address, how can i solve this problem?
Great video, but I get stuck.. at 21:05 you write /usr/local/samba/bin/smbclient //localhost/netlogon -UAdministrator%"password" -c `ls` .. There I get listed first Domain=[name] OS=[Unix] Server=[Samba 4.1.23] but line after i just get dns_update_cache: command not found .. Why do I get that? Am I missing something? I run Ubuntu server 16 LTS
Hello..
If i want to join this DC to an existing Active Directory with a primary DC.
Q: can i do that ?
Q2: And how do i do this?
Hi David, thanks for this tutorial this helps me a lot, however im stuck on the process of provisioning on samba.
how can I fix this ?
it says:
"ERROR(): Provision Failed!
thank you so much!
I getting this error RuntimeError: kinit for failed (Cannot contact any KDC for requested realm)
sudo systemctl disable nmbd
sudo systemctl disable smbd
sudo systemctl unmask samba-ad-dc
sudo systemctl enable samba-ad-dc
reboot
Hi sr.
i hope i am in the right place to ask this but i am following you
tutorial on how to install ADDC in a Ubuntu server machine, at the minute 18 of the video, and when i
run the "samba-tool domain provision" command [exactly as you showed in
the video] i received a "Usage: samba-tool domain provision [options]"
message after i hit enter, would you mind providing me with
fix/answer/help to that issue? thanks!
+IT Analyst
forgot two slashes before [dns-backend]... Fixed!
If you're trying to do a similar install today, libgnutls-dev should be changed to libgnutls28-dev or else you'll receive "... has no installation candidate"
I got all the way to the end and then Windows won't join the domain. I've tried everything. Sometimes it finds the domain but won't let the administrator account join it and other times it won't find the domain to connect to. I've changed the DNS settings and still no use. That's hours wasted.
Thanks for the guide, building the DC went very smoothly and I could login to windows 7 with the domain administrator account. However I have had problems trying to use the AD Users and Computers snap-in. After double clicking on it I get an error message "The domain ### cannot be found cannot be found because: Login failure:unknown username or bad password". Can you help me please with this issue?
Hi ! Can you help me pls? i have error /usr/local/samba/bin/smbclient -L localhost -U% so error :NT_STATUS_CONNECTION_REFUSED what is it ?
the same problem please help
Thank you. Worked perfectly! I've done all the configuration with samba server, and it's working perfectly.
Now i want to joins a ubuntu 17.04 client to this domain, please how can do it ?