|
Brett Wynkoop's GPG public key
Some Quick Tools for OS X
5 April, 2015, 11:07 pm in "Mac-OSX"
I was recently asked by a client to set up an old Mac G5 he had to be the mail and web server for his office. No problem I told him and after he did a fresh install from his 10.5 install disk, created an administrative account, and turned on SSH via the GUI, I fired up ssh from an xterm on my MacBook and went to work.
I quickly determined with Apples use of it's own LDAP server, /usr/sbin/DirectoryService, command line administration was going to be a bit painful for certain functions. Back when Apple used Netinfo a quick nidump/edit/niload cycle allowed for fast and easy modification of both passwd and groups. DirectoryService changed all that and the command line tools Apple provides for interacting with DirectoryService are not as well documented as they could be. In some cases the only documentation is the help message from a utility, or a very poorly written man page which leaves out options the help message includes. To top this off Apple offers no support for any command line operations in OS X. Some research on the net showed me that just to create a user account was a multi-step process using dscl repeatedly and following on with the use of createhomedir. Not only was creating users from the command line time consuming there were many chances for errors due to the many times dscl had to be invoked with different options and arguments. What is a systems administrator to do? AUTOMATE is the answer, and that is just what I did. The two operations I decided to attack first were adding users and adding existing users to groups. For adding users I opted for the interactive method where the user was prompted for needed information. For one off user additions I find it an easier model to use than something that takes several options and arguments from the command line. For group additions I opted for a single command line invocation "addtogroup user group". So in short order I had the adduser and addtogroup written, doing what I needed, and no more. There is room for enhancement in both of these programs, but they might be useful. You can find them, and any other OS X specific utilities I produce in the future at http://shaken-not-stirred.tekhq.com/osx/utils/. -Brett wynkoop--at--wynn.com [ No Comments Yet
| Permalink
]
Comments No Comments Yet - Post Comments |