Information
Total Authors: 15
Total Articles: 40
Here I will explain a solution that worked for me to configure an Ubuntu workstation to authenticate with an Active Directory domain. The workstation was able to browse domain resources (ie, filesystem) without having to log in and it pulled the AD group information from the domain controller. A process was used to map certain groups to Linux (Ubuntu) groups, however extensive verification of the results could not be performed.
If you're using a VMWare client then you must set a static MAC address, don't allow your VM software to automatically update the MAC address.
Setup your network
First, set your IP to static IP and configure DNS to point to your domain controllers or any other DNS server you may have. This will allow you to call Windows computers by their short names. You must also fill in the Search Domains with your domain name.

Notice that I used "mydomain.local". This causes a stupid issue with mDNS that will need to be adjusted. If you use something like "mydomain.com" then you shouldn't need to do the next step.
Modify nsswitch.conf (fix the .local mDNS issue)
Open the file /etc/nsswitch.conf by starting your terminal (Applications >> Accessories >> Terminal) and type in:
sudo gedit /etc/nsswitch.conf
Modify the line that reads:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
Change it to:
hosts: files dns mdns4_minimal mdns4
This should allow a program called Likewise-open to authenticate with Active Directory and create a computer account.
Install Likewise-open
Now, in the terminal, type in
sudo apt-get install likewise-open5 likewise-open5-gui
You can also use Synaptic and search for "likewise". You'll notice a likewise-open and also likewise-open5. They both seem to work. I have installed likewise-open5 and likewise-open5-gui.
Join the domain
Once those are installed you can configure Likewise-open by going to System >> Administration >> Active Directory membership. Likewise-open will ask you for a username and password. This user must have privileges to join a computer to the domain.

You can also use the command line to join the computer to the domain:
sudo domainjoin-cli join mydomain.local Administrator

sudo visudo
%MYDOMAIN\\Domain^Admins ALL=(ALL) ALL

DOMAIN\username@ubuntu-client:~$ id uid=1234567889(username) ....
sudo gedit /etc/passwd
DOMAIN\username:x:1234567889:0:John Doe,,,:/home/DOMAIN/username:/bin/bash
DOMAIN\username:x:1234567889:1234567889:John Doe,,,:/home/DOMAIN/username:/bin/bash
Comments (6)
2009-12-12 05:43:41Lancelot
This is great. I'll have to reread it more carefully and then try it out. Two questions: 1. I really feel queasy about adding things to my sudoers list. Is there any way to avoid this and still have it work?
2. What ports does Active Directory use -- can this be used to tunnel AD connections through SSH (e.g. from my home laptop to work)?
2009-12-12 06:56:07Matt Simmons - http://www.standalone-sysadmin.com
Cool, thanks. I'm so glad that Likewise Open is showing up in Ubuntu. It's just so much better than doing it manually. I first found it in August of 2008, and I was highly impressed, to say the least. I can't recommend it to enough people!
2009-12-12 07:16:39Allan Bogh - http://www.opencodeproject.com
@Matt - Sorry about the comment system being slow. I'm fixing it this weekend. I've cleaned up your comments and linked your URL. For everyone else, please give the comments a second or two to update and don't use HTML in your comment, I can't allow HTML, but I'll make the system a little bit better with links.
2009-12-12 07:21:16Allan Bogh - http://www.opencodeproject.com
@Lancelot: The Sudoers part is completely optional. This is only necessary if you want Domain Admins to be part of the list, otherwise you can just login as your local admin in Ubuntu. Domain Users will log in as a normal User account if you don't add them to sudoers.
I believe AD uses 52 and 53 for DNS, 88 for Kerberos, and 445 for microsoft-ds.
2009-12-15 08:47:17software developer - http://www.geeks.ltd.uk/Services.html
Cool,
Thanks for sharing,
Keep up the good work
2009-12-18 04:26:54Software companies - http://www.geeks.ltd.uk/
Nice post,
I now have ubuntu set up and it s working great,
Thanks for writing, most people don't bother.