My testing environment:

Windows Server 2012 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. You only need likewise for this task. Trying to install likewise and winbind at the same machine will 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 that it reads:
hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4

'

3. To get the log-in screen for domain users, you will need the trick provided by Ahatius(http://askubuntu.com/questions/170325/enable-domain-login-on-login-screen)

'

Acutally adding a greeter-hide-users=true to /etc/lightdm/lightdm.conf was enough (it disables the history of users on the login screen and adds a field where you have to enter username and password).

'

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

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

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

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

What you will need

  • An already running Ubuntu installation (I prefer 10.04, but 9.10 should work fine).
  • Domain name: This will be your company domain.
  • DNS: If your machine uses something like OpenDNS, you might need to have the IP address(es) of your company DNS server(s).
  • Access: You are going to need authentication credentials for an account that is able to join a domain.
  • GROUP: You will need to know the group your user belongs to on the domain.

Installation

This is 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-open5likewise-open5-gui,  and winbind for installation (the Add/Remove tool will pick up any necessary dependencies for you).
  4. Click Apply to install (and Apply to accept any dependencies).

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

Joining using the command line

You will be surprised how easy this 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 Windows domain you want to join and USER is the user you authenticate with. You will be prompted for your user password and, upon successful authentication, you will have officially joined that domain! You should be able to do 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 you can do so equally as easy with the command:

sudo domainjoin-cli leave 

This will drop you from the domain you are 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 up the graphical tool (see Figure 1). This should be fairly straight-forward. You can name your computer what you want but you do have to use the exact domain name you would use to connect a Windows machine to your domain. In other words, if you domain is DOMAIN.LOCAL then useDOMAIN.LOCAL. If your domain is just DOMAINthen just use DOMAIN. As well, if you have to use an OU (Ogranizational Unit) to connect, make sure you have that correct.

Once you have the information entered click Connect and an authentication window will 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 will attempt to connect.

Upon successful authentication you will be a part of your company domain. Congratulations!

Logging in

Now log out of your desktop and log back in with your domain credentials. This most likely will mean you will log in with the username in the DOMAIN\user configuration. You can also log in to your local machine by logging in with the standard username and password on your local system.

Sudo issues

You will find, when logged into your domain, that your user doesn't have sudo privileges. This means you will not be able to install software and administer various tasks/tools. You can fix this by making an 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 is the group your user belongs to on the domain.

Now log out and log back in and your domain user should have sudoer privileges.

Final thoughts

I remember the days when 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 has worked for me flawlessly on a number of domains. If you have trouble connecting to your domain, post the information below (just don't break company policy by posting information that should not be made public) and see how quickly any given member of the Linux.com community comes to the rescue. Bazinga!

How to join a Ubuntu to Windows Domain的更多相关文章

  1. Join/remove server into/from windows domain PS script

    Join server into windows domain PS script $username = "ad-domain\admin" $Password = " ...

  2. remote desktop connect btw Mac, Windows, Linux(Ubuntu) Mac,Windows,Linux之间的远程桌面连接

    目录 I. 预备 II. Mac连接Windows III. Windows连接Mac IV. Windows连接Ubuntu V. Mac连接Ubuntu VI. Ubuntu连接Mac VII, ...

  3. 在ubuntu on windows 上安装jekyll

    已知问题 安装ruby之后,重新启动ubuntu on windows,输入ruby命令,提示找不到. 发现的解决办法 执行下面命令 source /home/xxxx/.rvm/scripts/rv ...

  4. 解决Ubuntu和Windows的文件乱码问题(转载)

    解决Ubuntu和Windows的文件乱码问题(debian也通用) 1.转换文件内容编码   Windows下天生的纯文本文件,其中文编码为GBK,在Ubuntu下显示为乱码,可以使用iconv命令 ...

  5. [2014.5.22][UBUNTU]Ubuntu与Windows系统时间不同步的问题

    安装Ubuntu+Windows双系统时会遇到Windows和Ubuntu系统时间不同步的问题,这是由于Windows系统默认读取主板bios等硬件系统时间作为OS的当地时间;而MAc,Linux类的 ...

  6. Ubuntu和Windows设备共享

    http://blog.csdn.net/pipisorry/article/details/51725942 蓝牙设备如键盘.鼠标都可以. 装的双系统win7和Ubuntu,如果只使用一个系统,蓝牙 ...

  7. Ubuntu和Windows双系统的安装

    本菜鸡的ACM生涯大概是结束了 最有希望的EC和焦作也顺利的铁了,一路走来还是怪自己不努力,整日整日的划水,算了,铁牌退役,也是自己应有的惩罚,静下心来吧 下面介绍如何装windows10和Ubunt ...

  8. Ubuntu登录Windows Server 2008r2 密码总是错误与NLA验证

    日期:2013-05-22   经过一天的折腾,终于能够用Ubuntu登录Windows server 2008 R2 了. 寝室里面用小本子,装的ubuntu,实验室的服务器是win server0 ...

  9. Ubuntu和Windows相互共享文件夹

    一.Ubuntu访问Windows共享文件夹 1.对需要共享文件夹右击->属性->共享 2.选择要与其共享的用户,选择好用户点击有点添加按钮添加,然后点击下方的共享按钮 3.完成共享 4. ...

随机推荐

  1. 标准的CSS盒子模型?与低版本IE的盒子模型有什么不同的?

    CSS盒子模型:由四个属性组成的外边距(margin).内边距(padding).边界(border).内容区(width和height); 标准的CSS盒子模型和低端IE CSS盒子模型不同:宽高不 ...

  2. Windows 2003 FastCgi安装环境

    Windows 2003 IIS+PHP5.4.3 安装教程 一.准备相关组件 安装前,先安装IIS. 1.安装FastCgi for IIS6 Fastcgi官方网址是:http://www.iis ...

  3. 在HTML文件中加载js

    js加载只分为两种: 1.全局js,放在<head>标签里面,整个页面很多都用到的,它是优先加载的. 2.局部js,放在</html>结束标签以内的任何位置,它是第二加载的.

  4. [原创] 初识Agile/CMMI/Scrum

    一.背景介绍 在朋友(aehyok)的建议下,初步去了解Visual Studio Online,简称VS Online(即原来的 Team Foundation Service,简称TFS) VS ...

  5. ASP.net UrlRewrite的防盗链功能

    ASP.net中如何实现基于UrlRewrite的防盗链. ASP.net中最快实现UrlRewrite的方法这篇文章中说了如何做UrlRewrite,那只是一个最简单的应用 其实利用UrlRewri ...

  6. php 安装redis扩展

    大家可以去http://code.google.com/p/redis/downloads/list这个地址找最近的下载wget http://redis.googlecode.com/files/r ...

  7. 主键、外键、超键、候选键的区别【Written By KillerLegend】

    先说一下属性的定义: 表的每一行对应一个元组,表的每一列对应一个域.由于域可以相同,为了加以区分,必须对每列起一个唯一的名字,称为属性(Attribute). 再来看看几个键的定义: 超键:在关系模式 ...

  8. gRPC Client的负载均衡器

    一.gRPC是什么? gRPC是一个高性能.通用的开源RPC框架,其由Google主要面向移动应用开发并基于HTTP/2协议标准而设计,基于ProtoBuf(Protocol Buffers)序列化协 ...

  9. USB协议分析

    一.USB设备描述结构 1.逻辑组织结构 在USB设备的逻辑组织中,包含设备.配置.接口和端点4个层次.设备通常有一个或多个配置,配置通常有一个或多个接口,接口有零或多个端点. 每个USB设备都可以包 ...

  10. angularjs2 学习笔记(三) 服务

    在anglar2中服务是什么? 如果在项目中有一段代码是很多组件都要使用的,那么最好的方式就是把它做成服务. 服务是一种在组件中共享功能的机制,当我们使用标签将多个组件组合在一起时我们需要操作一些数据 ...