How to join a Ubuntu to Windows Domain

Source: Internet
Author: User

MY Testing Environment:

Windows Server R2 Essentials:

With AD and standalone DC in one single box.

Ubuntu:

Ubuntu-12.04.1-desktop-amd64

Basically, I was following Jack's awsome blog to do it:

Https://www.linux.com/learn/tutorials/336477:how-to-join-a-ubuntu-machine-to-a-windows-domain

Notes:

1. Need likewise for the this task. Trying to install likewise and winbind on the same machine would throw you some PAM error. I personally used Likewise-open and Likewise-open-gui Insteand of Likewise-open5 or Likewise-open5-gui

2. Use the workaround provided by Gary (https://answers.launchpad.net/ubuntu/+source/likewise-open/+question/214599) If you meet name server error:

Open/etc/nsswitch.conf as root and modify line:
Hosts:files mdns4_minimal [Notfound=return] DNS Mdns4

Move DNS before mdns4_minimal so it reads:
Hosts:files DNS Mdns4_minimal [Notfound=return] Mdns4

3. To get the Log-in screens for domain users, you'll need the trick provided by Ahatius (HTTP://ASKUBUNTU.COM/QUESTIONS/1 70325/enable-domain-login-on-login-screen)

Acutally adding A to is enough (it disables the history of users in the login screen and greeter-hide-users=true /etc/lightdm/lightdm.conf adds a field where Y OU has to enter username and password).

-----------------------------------

No matter how to try, sometimes you can ' t escape the clutches of Microsoft and Windows. You might has a fortress of Linux solitude at home, but unless is one of the lucky ones working in a linux-only envi Ronment, you is going to the interact with Windows.

One of the trickiest aspects of getting Linux to play well with Windows are the Windows Domain. For the longest time this is a challenge most were simply isn't ready (or able) to handle. This task required a very deep understanding of samba and how to get the samba to communicate with that Windows domain. Even armed with the knowledge, this wouldn ' t always work. Even after hours of editing your/etc/samba/smb.conf file, you found yourself stumped until your simply gave up.

That's, until now. Fortunately, things has continued to get easier on the Linux operating system to where even what is once the most Challe nging tasks is mundane. One such tool that have made the challenge of joining a Windows domain is likewise Open. Using likewise Open ' s handy GUI tool (that also comes with a equally hand command line version) you can quickly and Easil Y connect a Linux machine to a Windows domain.

What do you'll need

    • An already running Ubuntu installation (I prefer 10.04, but 9.10 should work fine).
    • Domain Name:this is your company domain.
    • Dns:if your machine uses something as OpenDNS, you might need to has the IP address (es) of your company DNS server (s).
    • Access:you is going to need authentication credentials for an account that's able to join a domain.
    • Group:you would need to know the group your user belongs to the domain.

Installation

This was simple. Follow these steps to get both the GUI and command line tools installed:

    1. Open up the Add/remove software tool.
    2. Search for "likewise open".
    3. Marke likewise-open5, Likewise-open5-gui, and winbind for installation (the Add/remove tool W Ill pick up any necessary dependencies for you).
    4. Click apply to install (and apply to the accept any dependencies).

That ' s it. You is now a ready to join your Windows domain. Let's tackle this via command line first.

Joining using the command line

You'll be surprised how easy it is to do. Open up a terminal window and issue the following command:

sudo domainjoin-cli join domain_name USER

Where domain_name is the NAME of the that Windows DOMAIN you want to join and the user is the user-authenticate with. You'll be prompted to your user password and upon successful authentication, you'll have officially joined that DOMA in! You should is able to does things like browse all machines on your network domain as well as connect to your Exchange server Using evolution!

Now if you want to leave the domain can do so equally as easy with the command:

sudo domainjoin-cli leave

This would drop you from the domain currently joined. Now let's take a look at the same task from the GUI tool.

GUI Goodness

Figure 1

To start up the GUI click F2 and enterDomainjoin-gui to open the graphical tool (see Figure 1). This should is fairly straight-forward. You can name your computer "What are you Want" and "do" has to use the exact domain name of your would use to connect a Windows m Achine to your domain. In the other words, if your domain is domain. LOCAL then useDOMAIN. LOCAL. If your domain is just domainthen just use domain. As well, the if you had to the use of an OU (ogranizational Unit) to connect and make sure you had that correct.

Once You has the information entered click Connect and an authentication window would appear. In this window you must enter your username and your password as you would enter them when connecting on a Windows machine . After you enter your credentials click OK and likewise Open'll attempt to connect.

Upon successful authentication you'll be a part of the your company domain. congratulations!

Logging in

Now logs out of your desktop and log back in with your domain credentials. This is the most likely would mean you'll log in with the username in the domain\user configuration. You can also log into your local machine by logging in with the standard username and password on your local system.

Sudo issues

You'll find, when logged to your domain, that your user doesn ' t has sudo privileges. This means is not being able to install software and administer various tasks/tools. You can fix this by making a addition to the /etc/sudoers file.  Do this with the following warning:you can really mess up your system with an improperly configured /etc/sudoers file...so use Caution!

Open up the /etc/sudoers file and look for the line:

#Members of the Admin group may gain root privileges and do the following:

Under this line add the following:

%domain\group all= (All) all

Where DOMAIN is the actual domain and group are the group your user belongs to the domain.

Now logs out and logs back in and your domain user should has sudoer privileges.

Final Thoughts

I remember the joining a Windows domain was something very few could manage. Now anyone who can install an application can join a Windows domain. The method I describe have worked for me flawlessly on a number of domains. If you have trouble connecting to your domain, post the information below (just don ' t breaks company policy by posting info Rmation that should not being made public) and see how quickly any given member of the Linux.com community comes to the Rescu E. bazinga!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.