Samba 4 Domain Controller on Ubuntu 14.04 LTS
1. Configure network with a static ip address
$sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.35
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
dns-nameservers 192.168.0.1 114.114.114.114 8.8.8.8
dns-search szhnbc.com
2. Name your domain controller
$sudo hostname rd-server
$sudo echo "rd-server" > /etc/hostname
$sudo nano /etc/hosts
127.0.0.1 localhost
127.0.1.1 rd-server.szhnbc.com RD-Server
192.168.0.35 rd-server.szhnbc.com rd-server
$sudo apt-get update && apt-get upgrade
$sudo reboot
3. Install packages ntp, acl, samba + tools
$apt-get install ntp acl samba krb5-user smbclient
在安装Kerberos时,会提示输入相关信息
Your realm: SZHNBC.COM
Kerberos servers for your realm: rd-server.szhnbc.com
Administrative server: rd-server.szhnbc.com
4. Configure samba
Remove automatically created configuration
$sudo rm /etc/samba/smb.conf
Configure samba with samba-tool
$sudo samba-tool domain provision --realm szhnbc.com --domain szhnbc --adminpass Password123 --server-role=dc
注意:如果设置安全比较低的密码,会导致命令失败。
安装成功信息:
Looking up IPv4 addresses
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba and AD schema
Adding DomainDN: DC=szhnbc,DC=com
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=szhnbc,DC=com
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba has been generated at /var/lib/samba/private/krb5.conf
Once the above files are installed, your Samba4 server will be ready to use
Server Role: active directory domain controller
Hostname: rd-server
NetBIOS Domain: SZHNBC
DNS Domain: szhnbc.com
DOMAIN SID: S------
5. Configure DNS
对于大型,复杂的网络部署,建议你应该使用BIND,但在我的实际环境中,内建的DNS已经足够用了。
$sudo nano /etc/samba/smb.conf
dns forwarder = 8.8.8.8
allow dns updates = nonsecure
$sudo nano /etc/network/interfaces
dns-nameservers 192.168.0.35
$sudo reboot now
6. Test your new domain controller
$ host -t SRV _ldap._tcp.szhnbc.com.
_ldap._tcp.szhnbc.com has SRV record rd-server.szhnbc.com.
$ host -t SRV _kerberos._udp.szhnbc.com.
_kerberos._udp.szhnbc.com has SRV record rd-server.szhnbc.com.
$ host -t A rd-server.szhnbc.com.
rd-server.szhnbc.com has address 192.168.0.35$ kinit administrator
Password for administrator@SZHNBC.COM:
Warning: Your password will expire in days on Fri Jan :: $ klist
Ticket cache: FILE:/tmp/krb5cc_999
Default principal: administrator@SZHNBC.COM Valid starting Expires Service principal
// :: // :: krbtgt/SZHNBC.COM@SZHNBC.COM
renew until // ::
benny@RD-SERVER:~$ smbclient -L localhost -U%
Domain=[SZHNBC] OS=[Unix] Server=[Samba 4.1.-Ubuntu] Sharename Type Comment
--------- ---- -------
netlogon Disk
sysvol Disk
IPC$ IPC IPC Service (Samba 4.1.-Ubuntu)
Domain=[SZHNBC] OS=[Unix] Server=[Samba 4.1.-Ubuntu] Server Comment
--------- ------- Workgroup Master
--------- -------
HAICHUAN YANGXINFENG
MSHOME RD-SERVER
WORKGROUP HC-JXS
$ smbclient //localhost/netlogon -U'administrator'
Enter administrator's password:
Domain=[SZHNBC] OS=[Unix] Server=[Samba 4.1.-Ubuntu]
smb: \> quit
7. Manage your new domain controller
Recommended way of managing your server is to use "Remote Server Administration Tools", which you can install on Windows 7 desktop pc as a feature.
You can also manage users & groups with samba-tool
samba-tool user add john --surname=Smith --given-name=John
samba-tool group add test_group
samba-tool group addmembers test_group john
samba-tool user list
getent passwd john
id john
Samba 4 Domain Controller on Ubuntu 14.04 LTS的更多相关文章
- Install CUDA 6.0 on Ubuntu 14.04 LTS
Ubuntu 14.04 LTS is out, loads of new features have been added. Here are some procedures I followed ...
- Ubuntu 14.04 LTS 安装Docker
Docker官方是有很详细的安装文档(https://docs.docker.com/engine/installation/ubuntulinux/),这里做了一个Ubuntu 14.04 LTS中 ...
- 完整卸载 kubuntu-desktop from Ubuntu 14.04 LTS
系统 ubuntu 14.04 LTS 64Bit 目的:卸载kubuntu-desktop 方法一: sudo apt-get remove libkde3support4 k3b-data ntr ...
- Ubuntu 14.04 LTS 更新源大全
Ubuntu 14.04 LTS 系统更新源汇总 如何使用这些系统更新源?---三步走 首先备份源列表: sudo cp /etc/apt/sources.list /etc/apt/sources. ...
- Ubuntu 14.04 LTS 下 android 2.3.5 源码编译过程
Ubuntu 14.04 LTS 下 android 2.3.5 源码编译过程 在新的Ubuntu 64位系统下去编译早期的安卓源码是会出现很多问题的,因为64位系统在安装完成后,很多32位的兼容 ...
- Ubuntu 14.04 LTS 64bit 编译SDL的问题
http://blog.csdn.net/jhting/article/details/38523945 Ubuntu 14.04 LTS 64bit 编译SDL的问题 分类: C/C++2014-0 ...
- Ubuntu 14.04 LTS 与Kylin
现在是安装了Ubuntu 14.04 LTS 但是通过安装ubuntukylin 这个包居然实现了Kylin--原来这个自主研发还这么方便-呵呵 sudo apt-get install ubuntu ...
- 【转】基于Ubuntu 14.04 LTS编译Android4.4.2源代码
原文网址:http://blog.csdn.net/gobitan/article/details/24367439 基于Ubuntu 14.04 LTS编译Android4.4.2源代码 ...
- VM Depot 中国上的 Bitnami 镜像更新至 Ubuntu 14.04 LTS
发布于 2014-08-13 作者 陈 忠岳 随着越来越多中国本地镜像源源不断地加入, VM Depot 中国站点也在日益壮大(http://msopentech.com/?p=865871) ...
随机推荐
- 2017年1月4日-linux学习
老男孩Linux运维实战培训 1.EmEditor文本编辑工具,我用Notepad++也很好用 2.win32文本比较工具使用技巧,我用svn也很好用 3.安装vmware软件及新建配置虚拟机视频,已 ...
- Base64加密与MD5的区别?
MD5是一种不可逆的摘要算法.而Base64是一种编码方式,主要用于将二进制数据转换为文本数据,方便使用HTTP协议等,是可逆的.无论多少二进制数据,在MD5算法一定的情况下,都会变成一个定长的数据, ...
- Opera浏览器导出收藏到Chrome,和几个Chrome的一些小技巧
Opera浏览器还是不错的,但是用着不是特别爽,老是感觉怪怪的,也说不上来哪里不好. 还是换回了Chrome浏览器,Chrome浏览器有一个让我念念不忘的地方,就是收藏夹会自动显示,当打开网页之后,又 ...
- [SimHash] find the percentage of similarity between two given data
SimHash algorithm, introduced by Charikarand is patented by Google. Simhash 5 steps: Tokenize, Hash, ...
- 关系与导航属性(摘自微软MSDN)
关系与导航属性 本主题概述实体框架如何管理实体间的关系.还对如何映射和操作关系提供了一些指南. 关系.导航属性和外键 在关系数据库中,表之间的关系(也称为关联)是通过外键定义的.外键 (FK) 是用于 ...
- MongoDB学习笔记七:管理
[启动和停止MongoDB]『从命令行启动』执行mongod,启动MongoDB服务器.mongod有很多可配置的启动选项:在命令行运行mongod --help可以查看所有选项.一些主要选项如下: ...
- 鼠标光标聚焦到可编辑div的最末尾
<p> <div id='text' contenteditable=true style='width:100px;height:100px;border:1px #ccc;'&g ...
- Unicode 和 UTF-8 的关系
曾经这个世界上,有着gb2312,gbk,latin1,utf 等各种字符集,现在,我们也能不时的看到他们的身影. 但是值得庆幸的事,时过境迁,这些主要的字符集,都已经逐渐被utf8取代. 但是我们很 ...
- ios 写项目的时候遇到的问题及解决方案(1)
1.解决headerView不随cell一起滚动的问题 解决方案:myHeaderView为自己创建的view加在tableHeadView上, self.tableView.tableHeadVie ...
- web前端响应式
一.响应式概述: 不仅仅是通过屏幕尺寸来动态改变页面容器的宽度等,完整的响应式网站的实现需要考虑到这些问题:响应式布局.响应式html和css.响应式媒体.响应式javascript. 二.移动端布局 ...