[SOLVED] Linux Mint 21.3 - Having Trouble Joining Domain with Samba
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Linux Mint 21.3 - Having Trouble Joining Domain with Samba
I'm using Linux Mint 21.3, and I hope 22 comes out soon. However, I hope it doesn't come out until I figure this out... OK. I renamed my domain controller following some instructions somewhere. I was going to create it from scratch but I found out, that possibly just renaming it was better. I called the domain smiley.fname. I tried to use .home.arpa, but as I found out, I can't do subdomains off of that, or at least the way I was trying. I need subdomains off of my domain to make the thing work.
So I chose .fname, standing for family name. Then I could still have bunches of subdomains off of it, like clients.smiley.fname.
Now, I "think" windows 10 will still join the domain again. However, I'm having trouble joining the domain with Linux Mint 21.3.
Why? Well first off, I'm using scripts, as doing it without is error prone and now with my scripts I can repeat it over and over, on many machines.
The first thing, I needed to do, is write some code, so that I could either join the domain freshly, or join it when I'm already joined to another domain, which is my previous domain, which no longer works.
That code all works fine. I found out, I still need some of my old zones I think, so that the domain controller which is renamed works. Doing this, by restoring my snapshot and not removing some of the information, helps and I think the server now works - I think. I'm using windows server 2019 for my server.
I got the domain to join with samba, on my tests, I think it will keep working too. But now, I need to be able to add a line to the host file I think, because it won't do it's dynamic updates properly.
So how, can I have the computer add a line to the host file, in it's correct format in order to have an entry for my samba server which I want to join to the AD domain? If I can do that, and it works, and no longer tells me
Code:
NT_STATUS_INVALID_PARAMETER
...then I think I'm just about finished with my script. I'm testing on a VM.
...Will print the FQDN of the computer. If I could write those to a file, and also somehow get just the hostname part, which looks like I can use parameter "-s", for, even if I have newlines seperating the parameters instead of spaces, I can then replace the newlines with spaces in the file, and then write the output of the file to the end of the /etc/hosts file, and job done, I think. My problem, is that I'm also having permission issues when I try to write the file where I want it. A place that wouldn't mess with anything else. /etc/settings/hostdata, with hostdata being the file name.
I use /etc/settings constantly, as it's my standard for things like this. However, I would need root permission to write to the file. But looking at it again, I see that I probably have a permission issue anyway, and that dir is supposed to be 777, so it may not be an issue. Unless I'm relying on different standards and forgot it didn't need to be 777, I think that changing it to that, is the solution. But if this doesn't work, I'll be back here to say. If I can do that, my problem might be mute.
Those commands will set the host file up for me. Also, I needed to properly set the host name and domain name, according to my standard way of doing it. I'll repost my changes to my software later, back on github. It appears that I figured it out, with much thought and much time! I would have preferred to figure it out sooner, as it took basically my whole day. I'll retest on my VM, before I start applying it to my real machines. If I have more trouble, I'll mention it, but I think I can mark as solved unless I run into some kind of additional problem related to this.
I don't understand your problem with 'home.arpa', from my testing you can use subdomains with it e.g. ad.home.arpa
You also shouldn't have renamed your AD domain, it isn't supported by Samba
Finally, if you are going to set your hosts info in /etc/hosts, wouldn't it be easing using something like this:
If it's finally working, I don't want to mess with it for now, but I might in the future. So I put a note in my code for that. Thanks for the shortand! I'm going to assume for now, that the line isn't already there, and if it is, leave it up to the user to delete it. Being that smart doesn't seem right, and seems like it could backfire for now.
I know you can do ad.home.arpa, but what about ad2.ad.home.arpa or clients.ad.home.arpa? That was where I had trouble. Doing so, is needed for sure in my particular network, that's why I finally did fname. But perhaps I didn't know enough about AD to implement it properly. I don't know what's not supported about it with samba, but if it's working, and probably won't quit working, then I'm going to be fine. I DID have to leave some old data to get it to work, but it's working.
I renamed it because it will take a long, long time to rebuild the whole domain from scratch, because if one gpo is out of place, it won't work. What I need in the future, is some scripts to set it up. When I switch over to samba for the AD server as well, things will help. Right now, I'm stuck using windows server. I'm not a BIG AD network, but I'm big enough that I need the server to make things easier. I can always try to rename it again, if I can get home.arpa to work.
Then, I had to manually fix gpos, and then I manually fixed the DNS server, while leaving the primary zone alone, except removing every A/AA and CNAME record, except for the one pointing to the domain controller itself.
It sounds like technically, the other way would be easier, but much less effective for long term. Remember, the server for now, is Windows Server 2019, it's only most of the clients which are Linux Mint.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.