Mac OS X 10.5 Leopard: Direcory Utility, The end of Netinfo-程序员宅基地


    其实,在OS X Tiger 10.4中,原来有两个应用程序一个叫NetInfo,一个是Directory Access一个主要用于管理本地用户的,另一个用来设置绑定网络Directory服务的,这次的Directory Utility是把这两个的功能合并了。               
    还有其他的一些相关文章和具体命令使用的文章,相继贴过来,以备查用。

    用户要 注意的是,虽然从本文介绍的来说Leopard绑定AD要比Tiger容易了很多,但是其实依然还有好多问题目前还有待解决,用户很可能需要作一些workaround的工作。   

注:其中的图片和两行代码显示是我加入的。



While the general Mac user community is ooh-ing and ahh-ing over Mac OS X 10.5 features like Time Machine, or opining about the new Dock, Stacks, et al, those of us who support Mac users are deep into learning about one of the biggest below-the-hood changes to happen in any version of Mac OS X: The end of Netinfo.

When I say “end,” I mean it in the most “end-ish” sense. In Mac OS X 10.5, Netinfo is gone. Not “deprecated,” not “hidden away for only the most advanced users.” It’s gone. Deleted. It does not exist. No more Netinfo database, no more Netinfo Utilities such as nicl, no more Netinfo Manager. The entire structure for managing local users, groups, and other such things has been completely replaced by local Directory Services, and the Netinfo Database is now a series of XML files living in /var/db/dslocal/.

Netinfo is—well, was —a directory service used for user and computer management. Originally created for NeXTStep, Netinfo was able toDirectory Utility manage not only individual machines, but entire networks. Its biggest problem was that the rest of the world turned to LDAP for doing the same thing.

Why is the end of Netinfo such an important change? Because when it came to managing local users and groups—that is users you created on your Mac, or network accounts that were mapped to local accounts (a.k.a. mobile accounts)—Netinfo handled all that. When you created a new user in System Preferences, that was all just a nicer interface into Netinfo. When you enabled sharing on your Mac, managing access to shares was handled by Netinfo. Now, it’s all done by Directory Services.

This may seem like a sudden change to some, but the truth is, Apple’s been actively easing Netinfo out of the picture since Mac OS X 10.2. Starting with that release, and continuing into Mac OS X 10.4, Netinfo was reduced from the primary mechanism for managing not just local users and groups, but entire network directories, ala Microsoft’s Active Directory or Novell’s eDirectory, to being only used for local user management. With Mac OS X 10.5, that easing out is complete.

So what does this mean? Well to the average user—whatever that means anymore—not much. The things you used to manage users, file sharing, and so forth are all still there—they just talk to different plumbing. There are some new features in those areas in Mac OS X 10.5, such as the “Advanced Options” in Accounts in System Preferences that allow you to configure a user’s home directory, login shell, add/remove login aliases, and so forth; you used to have to go to Netinfo Manager for these. There’s also the new ability to share any folder on your hard drive, but that could have been done with Netinfo too. The real changes here are in other areas

The most obvious change for most is the death of the Netinfo database. With Mac OS X 10.5, all the Netinfo database information are in a series of plist files in /var/db/dslocal/ under nodes/Default/. Within there, you see a set of directories:


bash-3.2# ls -l Default/
total 0
drwx------ 10 root wheel 340 Oct 11 19:30 aliases
drwx------ 2 root wheel 68 Nov 3 10:15 computers
drwx------ 10 root wheel 340 Nov 13 14:56 config
drwx------ 72 root wheel 2448 Nov 13 08:49 groups
drwx------ 4 root wheel 136 Oct 11 19:30 machines
drwx------ 3 root wheel 102 Oct 11 19:30 networks
drwx------ 44 root wheel 1496 Nov 13 14:11 users


       Note: the above two lines is added by Tony Liu, Nov 18, 2008

Within each of these is a set of plist files where the data for that directory is kept, so in users/, there’s one plist per user, in groups/, one plist per group, and so on. Looking at the entry for the “staff’ group in staff.plist, (staff is the default group for all local users you create in Mac OS X), we see the following:


  
    bash-3.2# cat staff.plist     <?xml version="1.0" encoding="UTF-8"?>     <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"     "http://www.apple.com/DTDs/PropertyList-1.0.dtd">     <plist version="1.0">     <dict>     <key>generateduid</key>     <array>     <string>ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000014</string>     </array>     <key>gid</key>     <array>     <string>20</string>     </array>     <key>name</key>     <array>     <string>staff</string>     </array>     <key>passwd</key>     <array>     <string>*</string>     </array>     <key>realname</key>     <array>     <string>Users</string>     </array>     <key>smb_sid</key>     <array>     <string>S-1-5-32-545</string>     </array>     <key>users</key>     <array>     <string>root</string>     <string>tempadmin</string>     <string>jwelch</string>     </array>     </dict>     </plist>


It’s pretty easy to decipher. You have a UUID, or Universally Unique Identifier, a unique number that identifies the group outside of conventional Unix group IDs. You have the GID (or Group ID), the Unix group identifier number, the name of the group, the password for the group, (in this case, there isn't one), the realname (or the more human friendly name), a sid number used for windows file sharing, and then a list of users in this group, including my own, jwelch. If you go looking through all the other plists, they all look like this, more or less.

But so what? Why does anyone care about this stuff? Well, for one, these are all text xml files. You can view or edit them in anything that can handle text files, from Apple’s own Text Edit and Property List Editor, to BBEdit, to Emacs or vi. You don’t need a special database NetInfoapplication to view or work with these files. This makes them more easily maintainable and fixable. It also makes it easier for network administrators to manage local-only accounts on their network. The XML structure of these files makes it easier to integrate the data they contain into various kinds of user management tools, since almost everything out there, commercial and home-built can handle XML data.

Network administrators trying to manage Mac laptops on directories also benefit from the elimination of Netinfo. Prior to Mac OS X 10.5, binding a laptop to a directory was a painful process. Because of the way directory services worked in Mac OS X 10.4 and earlier, if your laptop was bound, or attached to a directory service, and you had to boot up or log in when you couldn’t see the network that directory service was on, you were in a world of pain, and would probably never actually log in, or get anything done. There were a few workarounds, but it was all very wonky, due to how Netinfo and its associated processes—in particular, lookupd—worked. With Mac OS X 10.5, all that is fixed, and now you can have a laptop bound to a directory, and it just works.

For those of you wondering what command line utilities you use, now that all the ni* utilities and lookupd are gone, it’s pretty simple. For general needs, you use dscl. If you want to see what group a user or another group are a member of, or check user/group UUIDs, you use dsmemberutil. To edit, create, manipulate, or delete groups, you use dseditgroup. To work with various Directory Service caches, including LDAP and DNS, you use dscacheutil. Finally, to enable root, you use dsenableroot.

The removal of Netinfo from Mac OS X is a major change from both the operational and historical perspectives. But in end, I think it’s one that was long in coming, and it will make Mac OS X much nicer to deal with from the administrator point of view—something that will aid Apple as it continues to establish a greater presence in the business world.

[ John C. Welch is a Unix/Open Systems Administrator for Kansas City Life Insurance and a long-time Mac IT pundit. ]


原文链接: http://blog.csdn.net/afatgoat/article/details/3332017

转载于:https://my.oschina.net/junwong/blog/46618

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/chengyixian7877/article/details/100993883

智能推荐

MQ的概念和RabbitMQ知识点(无代码)-程序员宅基地

文章浏览阅读1.2w次,点赞7次,收藏76次。MQ全称是MessageQueue(消息队列),是保存消息在传输过程中的一种容器,既是存储消息的一种中间件。多是应用在分布式系统中进行通信的第三方中间件,如下图所示,发送方成为生产者,接收方称为消费者。............_mq

如何做好Bug分析-程序员宅基地

文章浏览阅读1.5k次,点赞47次,收藏18次。Bug分析是QA的一项主要技能,需要针对项目中遇到的经典问题进行分类分析, 直达问题本质。 并且能够给团队其他项目或者成员起到典型的借鉴作用。 当然也有一些非常经典的问题可以进行技术深挖, 以供参考。 个人认为比较典型的「Bug分析」是stackoverflow, 当然, 一个完善的bug分析库, 可以进行问题分类总结。 对于测试新人是有很大的帮助的。本质上, 在测试领域很多问题是可重现可整理可规避的。另外, bug分析本身是为了拓宽每个人的认知边界, 缩小团队间的乔哈里窗以达到最佳的合作状态。一个「好的B

H5020NL PULSE 50PIN千兆四口网络变压器 HQST H85001S建议IC配置型号_4口网络变压器-程序员宅基地

文章浏览阅读800次。HQST导读:PULSE普思是网络通讯行业中龙头企业之一,其中网络变压器产品大都由国内代工厂代为生产,H5020NLHX5020NL千兆四口网络变压器是普思公司经典老牌产品,相对整个市场用量不是很大,集中生产约一月20万颗左右……PULSE普思是网络通讯行业中龙头企业之一,其中网络变压器产品大都由国内代工厂代为生产,H5020NLHX5020NL千兆四口网络变压器是普思公司经典老牌产品,相对整个市场用量不是很大,集中生产约一月20万颗左右,……PULSE H5020NL千兆网络变压器对应HQS._4口网络变压器

D20 EME 支持2k MAC地址表-程序员宅基地

文章浏览阅读242次,点赞3次,收藏9次。交换机,壳体采用镀锌钢板,结构紧凑,支持八个百兆端口,可配置一至四个百兆光纤端口。两路冗余电源设计,支持4pin可插拔端子,交直流通用,同时提供电源防接保护及过压、欠压保护,极大提升产品工作的稳定性。2.支持两路冗余电源设计,4pin可插拔端子,支持12~36V宽电压输入,交直流通用,同时提供电源防反接保护及过压、欠压保护,极大提升产品工作的稳定性。4.-40℃~75℃工作温度,-40~85℃存储温度,在极端气象条件下也能安全运行。8.支持IEEE802.3,IEEE802.3u,IEEE802.3x。

阿昌教你如何使用通义灵码-程序员宅基地

文章浏览阅读946次。Hi,我是阿昌,今天教你如何使用通义灵码。_通义灵码

老版本NDK下载列表(Android官网)_ndk 老颁布-程序员宅基地

文章浏览阅读2.3w次。我们在开发或编译旧版本NDK项目时,需要使用一些老版本的NDK,在这里提供了旧版NDK的列表及下载链接_ndk 老颁布

随便推点

网关、安全网关?与防火墙的区别(2),网络安全多线程断点续传-程序员宅基地

文章浏览阅读640次,点赞6次,收藏18次。网关是一个大的概念,没有特指是什么设备,很多设备都可以做网关,普通的PC机也能做,常用的网关设备是路由器。网关的作用主要是用来连接两个不同的网络,比如可以连接两个IP地址不相同的网络,或连接两个操作系统不同的网络,如WINDOWS与LINUX互连,或连接两个网络协议不同的网络,如TCP/IP与IPX.或拓扑结构不同的网络,如以太网和令牌环网。总之网关是一种中间媒介。而防火墙也可以做网关,但它的主要做用只是用来防病毒或防黑客,网关只算是防火墙的一个功能。网关与防火墙的区别。

解决:ModuleNotFoundError: No module named ‘pymysql’_modulenotfounderror: no module named 'pymysql-程序员宅基地

文章浏览阅读4.1k次,点赞42次,收藏34次。背景在使用之前的代码时,报错: Traceback (most recent call last): File "xxx", line xx, in import pymysql ModuleNotFoundError: No module named 'pymysql'翻译:```追溯(最近一次通话):文件“xxx”,第xx行,在导入pymysqlModuleNotFoundError:没有名为“pymysql”的模块```原因 ......_modulenotfounderror: no module named 'pymysql

android读取生成excel,Android创建与读取Excel-程序员宅基地

文章浏览阅读275次。1 import java.io.File;23 import java.io.IOException;45 import java.util.Locale;6789 import jxl.CellView;1011 import jxl.Workbook;1213 import jxl.WorkbookSettings;1415 import jxl.format.UnderlineStyle;..._android excel生成读取类

VS2015离线安装 安装包损坏或丢失_vs2015离线版csdn-程序员宅基地

文章浏览阅读4.3w次,点赞16次,收藏126次。1、去微软官网下载完成ISO镜像,最好不要在线安装,打开官方链接 https://www.visualstudio.com/zh-cn/downloads/download-visual-studio-vs.aspx按下图操作:2、用虚拟光驱加载,或者直接右键解压。在安装前,先安装两个证书。亲测,安装后,减少了很多“安装包损坏或丢失”的现象。两证书下载地址链接: https:/..._vs2015离线版csdn

解决vue中安装postcss-pxtorem插件,报错“ Error: PostCSS plugin postcss-pxtorem requires PostCSS 8.”_error: postcss plugin postcss-import requires post-程序员宅基地

文章浏览阅读2k次,点赞4次,收藏3次。目前 postcss-pxtorem 版本最高6.0.0,报这个错是因为插件版本太高,降成5.1.1可解决这个报错解决方法:分两步1.执行npm uninstall post-pxtorem2.执行npm i [email protected]_error: postcss plugin postcss-import requires postcss 8.

Linux-ARM开发_linux arm开发-程序员宅基地

文章浏览阅读787次。Linux-ARM开发_linux arm开发