<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Mac OS X SIG</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/" />
   <link rel="self" type="application/atom+xml" href="http://www.stanford.edu/group/macosxsig/blog/atom.xml" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog/1</id>
   <updated>2009-11-18T04:30:39Z</updated>
   <subtitle>Community supported Mac special interest group at Stanford University</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.32-en</generator>


<entry>
   <title>Build WebAuth with Mac OS X Server 10.6 (Snow Leopard)</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/11/build_webauth_on_snow_leopard_server.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.83</id>
   
   <published>2009-11-13T05:44:32Z</published>
   <updated>2009-11-18T04:30:39Z</updated>
   
   <summary>Stanford&apos;s WebAuth can now be installed cleanly on Mac OS X Server 10.6, permitting the use of Server Admin to manage websites.</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="advanced" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[<div><br /></div><a href="http://webauth.stanford.edu/">WebAuth</a>&nbsp;(cf developer&nbsp;<a href="http://www.eyrie.org/~eagle/software/webauth/" style="text-decoration: underline; ">link</a>)&nbsp;can be built cleanly on Mac OS X Server 10.6 with no additional flags or configuration edits. Just ./configure, make and sudo make install. Because of the changes in Snow Leopard server, you can now use WebAuth while continuing to use Apple's Server Admin.app tool to manage your web server.<div><br /></div><div>This is different than with Mac OS X 10.5, which has an httpd built with 64- and 32-bit PowerPC and x86 architectures. WebAuth, like many other Apache modules, did not build properly, since each module needed to be of four architectures, too. (Instructions for Leopard Server are <a href="http://www.stanford.edu/group/macosxsig/blog/2008/04/building_webauth_on_leopard_se.html">here</a>. For instructions on installing WebAuth on other Unix-like operating systems, see <a href="http://webauth.stanford.edu/install.html">here</a>.)<div><br /></div><div>Here's a list of things that are, I think, unique to the process of installing and using WebAuth on Mac OS X Server 10.6, after the jump.</div><div><div><ul><div><p></p></div></ul></div></div></div>]]>
      <![CDATA[<div><div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; list-style-type: disc; list-style-position: outside; list-style-image: initial; background-repeat: repeat-y; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">To compile WebAuth&nbsp;you'll need both&nbsp;<a href="http://www.eyrie.org/~eagle/software/remctl/" style="text-decoration: underline; ">remctl</a>&nbsp;and&nbsp;<a href="http://www.eyrie.org/~eagle/software/wallet/" style="text-decoration: underline; ">wallet</a>&nbsp;(necessary if you're a Stanford affiliate, so you can create stanford.edu&nbsp;<a href="http://www.stanford.edu/services/kerberos/sysadmin/wallet.html" style="text-decoration: underline; ">keytabs</a>).</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">To compile anything, you need Apple's free Xcode&nbsp;<a href="http://developer.apple.com/technology/" style="text-decoration: underline; ">developer tools</a>.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Modules live in /usr/libexec/apache2. The WebAuth build process properly uses&nbsp;<a href="http://httpd.apache.org/docs/2.2/programs/apxs.html" style="text-decoration: underline; ">apsx</a>&nbsp;to sort things in the proper location.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">The main httpd.conf live in /etc/apache2 while virtual hosts are called sites and live in /etc/apache2/sites. There is no extras directory, so all the other conf files live in /etc/apache2 too (plus there's no man or bin directories here either &#8212; those files are in their OS locations).</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Unlike tweaks on /etc/smbd.conf, you can make your httpd.conf edits anywhere. If your parameters conflict with what's entered via Server Admin, the entry closest to the end of the conf file wins.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Your WebAuth folder, then, also lives in /etc/apache2.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">The user/group that httpd runs as is _www (aka www); this is already in the default httpd.conf, along with entries specific to the HFS filesystem and other unique Mac OS X attributes like forked files.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Once you install the WebAuth modules, you can use Server Admin.app to enable/disable them. This still all writes to httpd.conf. The don't appear automatically. Either add them graphically using Server Admin or write them out manually in the httpd.conf file.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Apache is started using a&nbsp;<a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man8/launchd.8.html" style="text-decoration: underline; ">launchd</a>&nbsp;item at /System/Library/LaunchDaemons/org.apache.httpd.plist.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">The default webroot is /Library/WebServer/Documents &#8212; think of this as the htdocs directory.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">SSL certificates live in /etc/certificates; Server Admin creates httpd.conf files with proper paths to this directory, but you need to make hand edits if you have intermediate certificates.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Certificates are commonly managed using Server Admin.app too.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Although you'll see /private/etc/apache2/servermgr_web_apache2_config.plist, don't mess with this. That's what Server Admin.app writes to; if you edit this, you'll break the internet. The thing that takes Server Admin's XML values and schmooshes it into httpd.conf is /usr/share/servermgrd/bundles/servermgr_web.bundle/Contents/MacOS/servermgr_web.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b>Don't hook stanford-webauth.conf using an include in httpd.conf.</b>&nbsp;Instead, for some odd reason, you need to write out all those values in httpd.conf itself (wherever, but mine are at the end of the conf file).</li><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "></p><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; background-repeat: repeat-y; ">WebAuthLdapKeytab webauth/keytab<br />WebAuthLdapTktCache webauth/krb5cc_ldap<br />WebAuthLdapHost ldap.stanford.edu<br />WebAuthLdapBase cn=people,dc=stanford,dc=edu<br />WebAuthLdapAuthorizationAttribute suPrivilegeGroup<br />WebAuthKeyring "/etc/apache2/webauth/keyring"<br />WebAuthKeytab "/etc/apache2/webauth/keytab"<br />WebAuthServiceTokenCache webauth/service_token_cache<br />WebAuthLoginURL https://weblogin.stanford.edu/login/<br />WebAuthWebKdcURL https://weblogin.stanford.edu/webkdc-service/<br />WebAuthWebKdcPrincipal service/webkdc@stanford.edu<br />WebAuthSSLRedirect on<br />WebAuthDebug off</blockquote><div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; list-style-type: disc; list-style-position: outside; list-style-image: initial; background-repeat: repeat-y; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b>Don't put WebAuth access restrictions parameters in your main httpd.conf.</b>&nbsp;&nbsp;Server Admin.app will complain (accurately) it can't create charts and graphs to display in that applications monitoring window. This is because it's effectively prohibited by WebAuth itself. You'll see a message like this in your system.log.&nbsp;</li></ul><div class="codeblock">Nov 12 00:23:26 crc-resources servermgrd[86]: servermgr_web: In request for status, web service returned unexpected response code: 500; Server Admin Web graphs may be inaccurate.</div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><br /></p></div><div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "></p><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; list-style-type: disc; list-style-position: outside; list-style-image: initial; background-repeat: repeat-y; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b><span class="Apple-style-span" style="font-weight: normal; ">You need to move your WebAuth parameters to the specific vhost file in /etc/apache2/sites instead. This needs to be a hand-edit, since Server Admin doesn't permit raw editing of the configuration files.</span></b></li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b>Using mod_webauthldap.so, you need to create a symlink</b>&nbsp;where /usr/webauth is created to point to /etc/apache2/webauth. There is probably a flag that could be used to compile this module differently, but the symlink works just as well.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">You can set ACLs on the web-hosted directories and on /etc/apache2/webauth using Server Admin if you create a symlink targeted to some directory otherwise visible to the Finder.</li></ul><div><br /></div><div>That's it.&nbsp;<a href="http://www.stanford.edu/services/contract-support/" style="text-decoration: underline; ">We</a>&nbsp;use WebAuth on a Snow Leopard server quite well, with different parts of the file system served to different groups. Some web roots are also AFP and CIFS shares, which permit read/write to authenticated users. Another nice feature available with the built-in Apache 2.2 service is that administration can be controlled by service access controls, allowing granular privileges to users and groups designated either web server admins or monitors. &nbsp;It's a more elegant solution to use Apple tools on Mac web servers without having to resort to building and managing your own Apache installation and fighting with Webmin for GUI management.</div></div></ul></div></div>]]>
   </content>
</entry>

<entry>
   <title>Hiding directories containing spaces in Samba</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/10/hiding_directories_with_spaces.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.77</id>
   
   <published>2009-10-20T23:27:38Z</published>
   <updated>2009-10-21T00:09:58Z</updated>
   
   <summary>When configuring Samba 3 to hide Mac-specific directories from Windows users, I typically edit /etc/smb.conf on my Mac OS X Server, using either veto files = hide files = This worked fine &#8212; until it didn&apos;t. Seems I wasn&apos;t doing...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[When configuring Samba 3 to hide Mac-specific directories from Windows users, I typically edit /etc/smb.conf on my Mac OS X Server, using either

<tt>veto files =</tt>
<tt>hide files =</tt>

This worked fine &#8212; until it didn't. Seems I wasn't doing it properly.

There's a lot of (typically legacy) HFS detritus sprinkled around on a Mac server. When both AFP and SMB are enable, Windows users see these bits and pieces, much to their confusion. (These files and directories are invisible to Macs.)

Originally, I had this at the end of my smb.conf file, but once I added the final <tt>veto files =</tt> option below at the bottom, I was disappointed things didn't work as expected.
<div class="codeblock">[global]<br />&nbsp;&nbsp;veto files = /Thumbs.db/<br />&nbsp;&nbsp;veto files = /.DS_Store/<br />&nbsp;&nbsp;veto files = /.TemporaryItems/<br />&nbsp;&nbsp;veto files = /Network Trash Folder/</div>
It seems I was incorrectly adding the files and directories in my smb.conf file.  That last line refers to a directory that has a space in the middle.  When I did a 

<div class="codeblock">sudo serveradmin stop smb; serveradmin start smb</div><br />
they still were there, staring out at me. (By the way, I'm not confident in the smbcontrol reload-config command, since smbd is controlled by launchd on a Mac. I just do a quick severadmin command.)
<em><blockquote>NB: The slashes have nothing to do with the filename or with a path. See <a href="http://oreilly.com/catalog/samba/chapter/book/ch05_02.html">this entry</a> in the SMB book from O'reilly. They're there just so smbd properly parses out when an entry starts and ends. But it's the space that tripped things up.</blockquote></em>
So it seems what I needed to do was to group all the files and directories into one line, like what's below.

<div class="codeblock">&nbsp;&nbsp;veto files = /Thumbs.db/.DS_Store/.TemporaryItems/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/&nbsp;&nbsp;</div>

That was the trick. I'm not sure why, because seemingly the individual entries should work just as well as the string of filenames. Now those Mac filenames are now hidden from my Windows users.]]>
      
   </content>
</entry>

<entry>
   <title>Removing ADS for Samba Users</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/10/removing_extended_attributes_f.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.75</id>
   
   <published>2009-10-16T18:02:14Z</published>
   <updated>2009-10-16T18:35:13Z</updated>
   
   <summary>Alternate data streams are an NTFS-specific extended attributes; they can cause problems for Windows clients connecting to Mac servers via Samba. This article discusses three ways to mitigate these problems.</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
   <category term="125" label="xattr ads" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[Occasionally, I get a call that my Windows users connected to my Samba server on Mac OS X Server 10.5 can't manipulate a file. They get various errors when trying to open or download the file.  The problem seems to be random but consistent; some files show problems, others are fine &#8212; even in the same directory.

Consider whether the problem is related to <a href="http://www.securityfocus.com/infocus/1822">Windows NTFS alternate data streams</a> (ADS). (See also the <a href="http://en.wikipedia.org/wiki/Fork_(filesystem)">Wikipedia article</a>.) You can see whether this is the case using the Terminal.
<div class=codeblock>[root@hsd-data-server 10:48:10 /Files/Annoyances]# ls -l@<br />total 184<br />-rw-r--r--@ 1 bobjones  finances  26112 Sep 21 09:13 FY_10_budget.xls&nbsp;&nbsp;<br /> :ZONE.IDENTIFIER:$DATA	   26 <br />-rw-r--r--@ 1 janedoe  finances  62464 Sep 21 09:13 FY_11_budget.xls&nbsp;&nbsp;<br /> :ZONE.IDENTIFIER:$DATA	   26 <br /></div>

The extended attribute is the :ZONE.IDENTIFIER:$DATA part and needs to be whacked off. It's expendable.  One command uses the <tt>xattr</tt> command. (Note that you'll need to escape the dollar sign.)
<div class=codeblock>xattr -d :ZONE.IDENTIFIER:\$DATA senate.xls</div>

There are (at least) two additional ways to handle these.]]>
      <![CDATA[One way is script out a recursive command to run against a directory tree. <a href="http://www.zzamboni.org/brt/2008/05/07/removing-all-extended-attributes-from-a-directory-tree/index.html">This blog</a> gives an example of a shell script to execute.

Perhaps the best way is to modify your /etc/smb.conf file to ignore these altogether. Here's an example of the smb.conf file I use on my servers. The critical part here is the last line. Pay special attention to the commented instructions from Apple at the end of the document about where to put your additions (otherwise they risk being wiped out.).
<div class=codeblock>; Site-specific parameters can be added below this comment.<br />; END required configuration.<br />[global]<br />&nbsp;&nbsp;&nbsp;&nbsp;use kerberos keytab = yes<br />&nbsp;&nbsp;&nbsp;&nbsp;realm = stanford.edu<br />&nbsp;&nbsp;&nbsp;&nbsp;acl check permissions = no<br />&nbsp;&nbsp;&nbsp;&nbsp;veto files = /Thumbs.db/<br />
&nbsp;&nbsp;&nbsp;&nbsp;veto files = /.DS_Store/<br />&nbsp;&nbsp;&nbsp;&nbsp;veto files = /.TemporaryItems/<br />&nbsp;&nbsp;&nbsp;&nbsp;client use spnego = yes<br />&nbsp;&nbsp;&nbsp;&nbsp;client NTLMv2 auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;client lanman auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;client plaintext auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;lanman auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;log level = 1<br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>nt acl support = no</strong><br /></div>

This will obviate the need to selectively use the <tt>xattr</tt> command; I've found no negative consequences of this addition.]]>
   </content>
</entry>

<entry>
   <title>Directory Services, OpenLDAP and DNS pools</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/10/directory_services_openldap_an.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.73</id>
   
   <published>2009-10-01T22:50:22Z</published>
   <updated>2009-10-01T23:31:45Z</updated>
   
   <summary>When I configure a Mac to use an external directory system, it&apos;s usually our OpenLDAP directory. Using Directory Access.app in the Utilities folder (or the command line equivalent, dsconfigldap), I usually enter that hostname, ldap.stanford.edu. However, there are limitations to this.  If the IP address of that specific host changes, things break.</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="121" label="OpenLDAP Open_Directory Directory_System Mac Apple DNS_Pool" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[Like many universities, we use OpenLDAP for our central directory system. As you might guess, the hostname for this system is ldap.stanford.edu. This is actually a <a href="http://en.wikipedia.org/wiki/Round_robin_DNS">DNS pool</a>, though. There are multiple machines offering the same service. There's ldap1.stanford.edu, ldap2.stanford.edu, ldap3 and so on.

When I configure a Mac to use an external directory system, it's usually our OpenLDAP directory. Using Directory Access.app in the Utilities folder (or the command line equivalent, dsconfigldap), I usually enter that hostname, ldap.stanford.edu. However, there are limitations to this.

At some point during configuration, the Mac connects to the DNS pool, gets sorted to one of the physical machines, does a forward name resolution, then uses that numerical IP address for subsequent connections.  

Here's the rub: if the IP address of that specific host changes, things break. ]]>
      <![CDATA[It takes a rebind of some sort to re-resolve the name.  So the benefits of using a DNS pool (or even to use a FQDN) are mostly lost.  To make matters worse, it's unlikely your OpenLDAP <a href="http://www.ietf.org/rfc/rfc2307.txt">RFC2307</a> directory system isn't going to give you a list of replicas. The L in OpenLDAP is lightweight, after all.

(This does not apply to Apple's <a href="http://www.apple.com/server/macosx/technology/open-directory.html">Open Directory</a>, which, like Active Directory, is based on LDAP fundamentals. Open Directory addresses the limitations I'm detailing here because it tells the binding Mac to keep a list of replicas, which adds some degree of redundancy.)

This behavior has been explained to me as a performance enhancing, but considering its fragility, it's difficult to see the benefits.

To get around this, bind your Mac to the individual hosts in the DNS pool. In this instance, configure your Mac to bind to ldap1.stanford.edu, ldap2.stanford.edu, ldap3, and... well, that's probably enough.

This won't guarantee anything, but if ldap1 has an IP change and can't be found, it will roll over to ldap2 &#8212; until the question is answered. (Like, if you're asking a question about login authorization through the login window &#8212; does so-and-so have an account in OpenLDAP.)

Now, of course, oftentimes when one host gets an IP change, the process is applied to all the other hosts in the DNS pool &#8212; say, when they all move to a different network altogether. But, at least with this arrangement, you'll have some added robustness in your directory system configuration.]]>
   </content>
</entry>

<entry>
   <title>Getting LDAP entries to work in 10.6 Address Book.app</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/09/getting_ldap_entries_to_work_i.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.71</id>
   
   <published>2009-09-17T18:44:12Z</published>
   <updated>2009-09-18T19:05:44Z</updated>
   
   <summary>Special thanks to Florian Schoppmann for bringing this issue to the community&apos;s attention. I&apos;m extracting the steps to get Address Book and Mail to read from the Stanford LDAP directory. General instructions for setup can be found here: http://www.stanford.edu/services/email/config/osx5mail/ldap/index.html Since...</summary>
   <author>
      <name>Vijoy Abraham</name>
      
   </author>
   
   <category term="103" label="10.6" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="109" label="directory" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="113" label="directory services" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="107" label="LDAP" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="117" label="snow leopard" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[Special thanks to Florian Schoppmann for bringing this issue to the community's attention.  I'm extracting the steps to get Address Book and Mail to read from the Stanford LDAP directory.  General instructions for setup can be found here:

<a href="http://www.stanford.edu/services/email/config/osx5mail/ldap/index.html">http://www.stanford.edu/services/email/config/osx5mail/ldap/index.html</a>

Since Address Book in 10.6 does not allow for self-signed certificates, you will need to take the following steps to get it working:

<strong>1. Retrieve</strong> the certificate by going to Terminal and typing:
openssl s_client -connect mothra.win.stanford.edu:636

<strong>2. Copy</strong> everything in between

"-----BEGIN CERTIFICATE-----"

and

"-----END CERTIFICATE-----" (including these lines)

to a new file with suffix <em>.pem</em>

<strong>3. double click</strong> on the file you just saved (<file>.pem) to open it in Keychain Access

<strong>4. double click</strong> on the new certificate, click on the 'Trust' disclosure triangle and set "When using this Certificate:" to "Always trust".

As Florian says, <em>Voilà</em>!]]>
      
   </content>
</entry>

<entry>
   <title>Configuring the built-in Cisco IPSec VPN client in Snow Leopard and iPhone</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/08/using_cisco_vpn_with_snow_leop.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.67</id>
   
   <published>2009-08-27T17:53:35Z</published>
   <updated>2009-10-17T00:42:43Z</updated>
   
   <summary>Use the built-in VPN tool in Snow Leopard.</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="general" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="99" label="vpn 10.6 snow_leopard" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[Here's how to configure Snow Leopard (and iPhone) to use an enterprise Cisco VPN concentrator (which is what you connect to from internet when you want to virtually join  a company or school's LAN).

Open System Preferences --> Network --> click the plus sign (Create a new service). On the iPhone, choose Settings --> General --> Network --> VPN --> Add VPN Configuration.  On the Mac, chose VPN as the interface. Choose Cisco IPSec as the VPN type, and supply a service name as a description (an arbitrary name for the connection, whatever makes sense to you).

The rest of the necessary information is supplied by you eyeballing a configuration file (or profile file) used by the typical Cisco VPN client. These files have a .pcf extension and they're usually distributed by an organization as part of the Cisco VPN client installer, usually in a folder called Profiles, but sometimes they are distributed just by themselves for users of other Cisco-compatible VPN clients. 

If the .pcf has already been installed on your Mac, you can find the containing directory here: /private/etc/opt/cisco-vpnclient/Profiles/ &#8212; which you can see in the Finder by selecting Go --> Go to Folder... ---> and entering that full path above.

Not all the values in the Mac or iPhone configuration windows are used. Certificates, for example, are not common and can be left off or blank.  Passwords need not be entered and saved; instead, they can be entered whenever a connection is made.

Open the .pcf file using any text editor. You will see rows of options and values &#8212; these are what you will enter in the Mac or iPhone network preferences. For example, to enter your organization's server address, use the corresponding Host value in the .pcf file.

Back at the System Preferences --> Network --> VPN option, there's the Authentication Settings button. Here, you need two important settings: the Group Name and the Shared Secret.  The former is found in the configuration file under the GroupName line. The final field that's necessary to make the VPN connection is something called the "Shared Secret" (it is also sometimes called the Group Password). 

Cisco VPN clients use two factors for authentication to connect users to your LAN (called SUNet here at Stanford). One is very weak, and that's the Shared Secret.  The other is strong: your own username and password.

In the .pcf file, you will see this as the value associated with enc_GroupPwd line. You'll notice it looks like an encrypted string, a bunch of letters and numbers. Because it's encrypted, you cannot cut-and-paste this string into the System Preference field.

I can't tell you what that string is or what it decrypts to, but it's simple enough to use a <a href="http://lmgtfy.com/?q=cisco+vpn+group+password+decrypt">search engine like Google</a> to find a website that decrypts Cisco group passwords. You enter the long string, click a button and it spits out the passphrase. It's that passphrase that you enter in the Mac or iPhone's Shared Secret field.

What will this Shared Secret get you? Remember, it's only one of two factors necessary to connect. The other, of course, is your username and password. That should never be disclosed, shared or mismanaged.]]>
      
   </content>
</entry>

<entry>
   <title>AFP stops logging after indicated period</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/07/bug_with_afp_logging.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.65</id>
   
   <published>2009-07-10T17:02:00Z</published>
   <updated>2009-10-21T01:07:01Z</updated>
   
   <summary>A bug in the AFP filesharing process stops logging after x-period of specified time. Here are three workarounds.</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
   <category term="95" label="AFP logging newsyslog bug" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[There's a bug with the Mac OS X Server 10.5.7 <a href="http://en.wikipedia.org/wiki/Apple_Filing_Protocol">Apple Filing Protocol</a> (AFP or "Mac filesharing") process where (perhaps under certain conditions) it fails to restart logging after an arbitrary period of time as specified in /Library/Preferences/com.apple.AppleFileServer.plist (which is typically edited via the Server Admin.app tool). 

<blockquote><em><strong>This bug appears to persist in Mac OS X Server 10.5.8.</strong></em></blockquote>

For example, if you set AFP to rotate logs every 14 days, the system should compress and roll over logs located in /Library/Logs/AppleFileService every-other week. However that appears not to happen. It will begin to log after the AFP service is restarted, though that's a drastic action.

I presume that /usr/sbin/AppleFileServer handles it owns logs, rather than /usr/sbin/newsyslog, which deftly takes care of old-school logs like ftp.log, system.log and ipfw.log. It's initiated every midnight by the the launchd item /System/Library/LaunchDaemons/com.apple.newsyslog.plist. (It's worth noting that this is not the same as asl, or Apple System Log.)  

Anyway, here are three workaround ideas to consider (certainly there are more).]]>
      <![CDATA[You could just set the "Archive every [x] day(s)" option in Server Admin --> AFP --> Settings --> Logging to where x equals something like 180 &#8212; but with a lot of filesharing activity and with logging set to record many types of events, your AFP log could grow to an undesirable size.

Another workaround would be to issue a HUP to AppleFileServer. This will not affect currently connected users, but will restart logging. This could be automatically initiated periodically by your own launchd item.

My solution was to set my preference for log rotation to a very high number of days, then use newsyslog to roll over the AppleFileServerAccess and Error logs. You can edit this yourself by modifying /etc/newsyslog.conf.  Here's an example of two lines to include: <div class="codeblock">/Library/Logs/AppleFileService/AppleFileServiceAccess.log  644 30 1024 * J /private/var/run/AppleFileServer.pid&nbsp;&nbsp;&nbsp;</br>
/Library/Logs/AppleFileService/AppleFileServiceError.log  644 30 512 * J /private/var/run/AppleFileServer.pid&nbsp;&nbsp;&nbsp;</div>

Here, I've told newsyslog to roll the AFP logs by indicating the full path, set the permissions to 644, keep 30 compressed logs, initiate the action when the logs become 512KB or more, and to use bzip2 as the compression method. The last value is the location of the pid; we need this so newsyslog can properly handle the process. Failure to include this will prevent AFP from restarting logging. And like a HUP, it does not affect logged-in users.  A space is needed between each of the values; I haven't had the need to load/unload the newsyslog launchd item, either. Finally, you can tell newsyslog to run at will by the "sudo newsyslog -Fv" command. This is good to do so you can see if you have a syntax error. 

See the man pages for <a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man8/newsyslog.8.html">newsyslog</a> and <a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man5/newsyslog.conf.5.html#//apple_ref/doc/man/5/newsyslog.conf">newsyslog.conf</a> for more info. (Incidentally, this has been entered as a bug at Apple's radar site; a fix is expected to be forthcoming, though perhaps not until Snow Leopard.)]]>
   </content>
</entry>

<entry>
   <title>Server Monitor.app stupidity</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/06/server_monitorapp_stupidity.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.63</id>
   
   <published>2009-06-05T17:56:36Z</published>
   <updated>2009-06-05T18:41:49Z</updated>
   
   <summary>Configuring Server Monitor.app locally and remotely on two different Xserves models is done quite differently, despite the same user interface. It&apos;s unintuitive and limiting.</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="91" label="CANNOT_LOAD_ BUNDLE_ERR" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[This confounded me until it I sorted it out. Once done so, it made sense, but it doesn't help that, in this case, the user interface is unhelpful and unintuitive, and the behavior is different than other configurations for similar machines. (Note: I haven't regressively seen is this is the case pre-<a href="http://support.apple.com/kb/HT3398">Mac OS X Server 10.5.7 Update</a> or pre-<a href="http://support.apple.com/kb/HT3314">Server Admin Tools 10.5.7</a>.)

On this <a href="https://support.apple.com/specs/xserve/Xserve_Late_2006.html">Xserve (Late 2006)</a>, Server Monitor.app on the local machine has the LOM feature configured for Network 1 (which corresponds to <em>en0</em> aka the port labeled Ethernet 1 on the machine and by default the Network preference pane).  This LOM interface has its own MAC address distinct from the physical port. I've registered this address for convenience's sake.

To configure this server for monitoring, launch Server Monitor --> Server --> Configure Local Machine. Give it an IP (again, distinct from the physical Ethernet ports), give it a username and password.  This is the only step that's the same on this and the Xserve (Early 2008) model.]]>
      <![CDATA[
<strong>Here's where it gets unintuitive.</strong>

If you want to add the server in Server Monitor application <em>on the server itself</em>, you'd think you could enter the IP associated with the LOM address you just entered in the step above. That will likely fail with "can't connect to server". Instead, you need to enter the loopback address, 127.0.0.1. And instead of entering the username and password entered a moment ago, you need to enter any old administrator's username and password instead. Any member in the local admin group, including those added from external directories, will suffice.  

You'll know if you did this incorrectly if you see a CANNOT_LOAD_ BUNDLE_ERR or "Software is not installed proper on server" message.

However, if you want to configure Server Monitor on a different, remote machine, the process is different, even though the user interface is the same.  Here, you will need to enter the LOM-specific address and enter the LOM-specific username and password.

I suppose this makes some sense, but the consequence means you have to disclose this LOM username and password to others if you want to delegate monitoring; you can't just add that person to the server's local admin account and call it a day. 

And unfortunately, there are no SACLs for this privilege, which would be most welcome. Perhaps allowing one group to monitor while another, more privileged group can shutdown or startup the server and configure the email notifications.

Over on this <a href="https://support.apple.com/specs/xserve/Xserve_Early_2008.html">Xserve (Early 2008)</a> model, the process is different, though the user interface is the same. Here, there is still a discrete LOM-associated MAC address; and you still give it a different IP address than the built-in Ethernet port(s). However when you configure Server Monitor.app on the server itself, it's done oppositely as the example above &#8212; do this the same way as you would from a remote monitoring machine. You use the LOM-specific FQDN or IP, and the LOM username and password, not a local admin account.  The remote monitoring machine is done the same way.
]]>
   </content>
</entry>

<entry>
   <title>CrashPlan Pro Server restore metrics, estimates</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/04/crashplan_pro_server_restore_metrics.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.59</id>
   
   <published>2009-04-29T23:46:15Z</published>
   <updated>2009-05-05T22:47:39Z</updated>
   
   <summary>Updated May 05, 2009 Additional information, clarifications and corrections have been added inline. After the publication of this blog post, I discussed an unrelated experience with the CrashPlan Technical Support team. They provided the information I&apos;ve added here; this update...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[<blockquote><strong><em>Updated May 05, 2009</em></strong> <em>Additional information, clarifications and corrections have been added inline. After the publication of this blog post, I discussed an unrelated experience with the CrashPlan Technical Support team. They provided the information I've added here; this update concerns changes in product naming, decryption, decompression and a partial explanation for slow restore times.

One particular note about product offering and features: There is a consumer and business product, and within the consumer release, there are different versions.  To help compare the consumer version, visit <a href="http://www1.crashplan.com/consumer/features-compare.html">this web page</a>.  This article talks about CrashPlan Pro, which is the enterprise solution.</em></blockquote>

I've deployed <a href="http://www.crashplan.com/business/">CrashPlan Pro Server</a> (CPPS) as a backup solution for a department here at Stanford. They use it for both their desktops and servers.  As is best practice, I performed a dry-run restoration of their files kept a network-attached storage. I used the performance metrics to make a back-of-the-envelope guess at how this would compare if we used our direct-attached FireWire 800 device as the backup repository.]]>
      <![CDATA[<strong>CrashPlan Pro Server background</strong>

CPP is a terrific backup solution for small businesses that want to hold onto their data on the premises (see the first side note below). It should not be confused with CrashPlan Pro (personal edition), which allows users to back up their computer to magical, hosted servers in the foggy internet (not unlike <a href="http://mozy.com/pro">Mozy Pro</a>).

With the <em>business</em> version, you install the client on your workstations and the CrashPlan Pro Server on just about any type of other machine (a Mac, Windows, Linux, Solaris &#8212;they even have a VMware virtual appliance). 

You run a client on a workstation, the CrashPlan Pro Server talks to the client and moves the files to your own storage device. They do have a hosted service if you would like your data off-site, just like the personal version. You can do both concurrently, actually.

And aside from impressive performance and a (somewhat) easy-to-use web-based management console, CPP has all the advanced features one expects nowadays, including de-duplification, compression and encryption. Best yet, they give away the CrashPlan Pro Server software; you just pay licenses for the number of clients you're backing up.

<blockquote><strong>Regarding encryption:</strong> The CrashPlan Pro Server does <em>not</em> do the encryption and decryption. Instead, it is the client running on the workstation that first encrypts the files to be backed up, sending it across the network as a secure block. During a restore, the process is reversed. The CrashPlan Pro Server sends the encrypted files back across the network to the client, which handles the task of decryption.</blockquote>

<blockquote><strong>Regarding decompression:</strong> This is where restoration really benefits from having a workhorse of a client (not, as I emphasize later, of the server).  The CrashPlan client will verify the integrity of the incoming block from the CrashPlan Pro Server; it will decrypt <em>and</em> decompress the file; write the file to disk; then verify the file's checksum to further ensure integrity, which might have been compromised by client activity or other workstation hardware issues.</blockquote>

<blockquote><strong>Regarding factors influencing restoration speed:</strong> The three primary factors that determine restoration speed would be the disk read speed on the Xserve (or your storage device); the speed of your network (both between your Xserve and it's network datastore; and also from the Xserve to your workstation). Finally, the speed of disk writes on the workstation matter, naturally.</blockquote>

<strong>Testing procedure</strong>

In the test of our backup and restore procedure, I initiated a full restore of all the Dean's Office data that normally lives on a dedicated, internal RAID 1 volume. This is an Xserve (Late 2006) model with two dual-core Xeon processors, 4 GB of RAM and three SATA drives. The machine is primarily their workgroup file server for about thirty to forty people, typically with less than five concurrent AFP and SMB sessions.

Our CrashPlan Pro Server runs on this Xserve. It backs up the department's workstations, as well as the server on which it runs.  I wanted to get some (very) rough metrics on how long a restore process would take; in the event of a catastrophe, the Dean's Office would have a tough time waiting it out.

I am looking first at how long it took to restore 451,418 files (184.47 GB) from our current storage repository, the campus <a href="http://www.stanford.edu/services/storage/lowcost/">Low Cost Central Storage</a> (LCCS) option. This is a cost-recovery service for campus affiliates looking for expandable CIFS storage at 35¢ a gigabyte. The Mac server is connected to the EMC network-attached storage via a static CIFS mount. (That itself was a challenge.)

<strong>Restore results from our NAS</strong>

Here is the entry from the CPP Server restore log:

<div class="codeblock">04/21/09 05:01PM 356326319858113082 Starting restore from HSDO CrashPlan Server: 451,418 Files (184.47 GB)&nbsp;&nbsp;&nbsp;

[...]

04/21/09 11:07PM 356326319858113082 Restore from HSDO CrashPlan Server completed: 445,910[1] Files restored  @ 2812.78 KB/s [22 Mb/s]&nbsp;&nbsp;&nbsp</div>

This log entry tells us that it took about six hours to restore the files, with an average speed of 22 megabits per second. What this number represents is unclear to me, but the CPP Server program has to decrypt and decompress everything en route to the restore destination. So even though the network is (at least) 1000baseT, there's significantly more overhead than just moving data. (It would stand to reason that having a beefy server to do the heavy mathematical lifting helps to improve things.)

<strong>Estimating the same activity from the DAS</strong>

Let's now make a back-of-the-envelope estimation of how this would compare if we restored from our other backup archive repository, a <a href="http://eshop.macsales.com/item/Other%20World%20Computing/MR1FWU2R2.0T/">directly-attached 1U RAID 0+1 device</a>, configured as one volume dedicated to CPP. It's attached via two FireWire 800 connections (one for each mirror, I suppose).  

To see how fast I could talk from the DAS back to the internal hard drives on the server, I averaged the results of moving a 10 GB file three times. This figure was 339 megabits/sec. (You weren't expecting 800 Mbps were you?)  Before you can say, "wait, that's one fat contiguous file, without decryption and decompression, of course that will be fast," keep in mind I'll try to account for a real-life scenario by using the performance penalty demonstrated with the original restore from the NAS. While this might not be entirely reliable, it's still informative.

In looking at the 21 Mb transfer rate, we see from comparing the throughput test results below that the approximate penalty in the restoration process is 46% &#8212;that is, restoring approximately 450,000 files comprising 180 GB is 54% slower that if we just moved one, 10 GB file. Using this as a baseline, the restoration of the same archive from the FW800 volume could be mathematically estimated as follows:

339 Mb/s * .54 [the restoration penalty] is about 183 Mb/s
183 Mb/s is about 23 MB/s
180 GB restored at 23 MB/s is about 8,013s, or 2:15 hours

[or, to compute this another way]

339Mb/s * .54 is about 183 Mb/s
184.47 GB is 1,511,178 Mb
1,511,178 Mb / 183 Mb/s is 8,258 seconds, or 2:18 hours

Now, this is just some rough math, and there are lots of other variables in play (the network might have some exceptional congestion, the server was simultaneously busy with other tasks, who knows). But it's safe to estimate the restoration time from the directly-attached FireWire 800 storage array would take a little over two hours, versus the six it took to go over the network.

<strong>Side note #1</strong>

I have no relationship with CrashPlan Pro except that I'm a customer who has paid them money for serial numbers and licenses; plus I've used their technical support, too . They have no association with this blog, my review, or Stanford University.

<strong>Side note #2</strong>

Three times I used rsync to move one contiguous 10 GB file from the operating system's internal RAID volume to four different destinations. I'm adding them here, should they interest anyone.

Average throughput moving one 10 GB from the server's OS volume to... 

<ul>	<li>Low Cost Central Storage (CIFS NAS) : 39 Mb/sec</li>
	<li>AFP to another Mac server across campus : 179 Mb/sec</li>
	<li>The FireWire 800 DAS : 339 Mb/sec</li>
	<li>The internal data volume on the same server : 413 Mb/sec</li></ul>


<strong>Side note #3</strong>

One thing about the campus' LCCS offering: at some point in the not-too-distant future, data from the EMC NAS will be replicated across the Bay to a data center being built in Livermore. It would be interesting to perform a similar restore from 40 miles away (and on another fault line).

<strong>Side note #4</strong>

Within the CrashPlan Pro web-based interface, there is an option to do a speed test to gauge the throughput between the CrashPlan Pro Server and your chosen archive repository. After submitting a help ticket with CrashPlan Pro's (pretty great) technical support, I was informed these results are unreliable and "not intended for large servers."  This speed test does a one-time transfer of a single ~60 MB file. It presents a red herring result: a dismal 3-8 Mb/sec transfer rate to the NAS.

<strong><u>Really important side note</u> #5</strong>

Currently, CrashPlan Pro (the enterprise backup solution I've been discussing in this article) does <em>not</em> respect access control lists (ACLs).  It's important to review the list of supported metadata <a href="http://support.crashplanpro.com/doku.php/getting_started/overview#supported_metadata">provided in the CrashPlan Support Wiki</a>.  

Support for ACLs is<a href="http://support.crashplanpro.com/doku.php/release/m22"> expected in the next release (M22)</a> which has no announced released date at the time of this posting.]]>
   </content>
</entry>

<entry>
   <title>Scary Excel &quot;Share Workbook&quot; feature behavior</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/04/shared_workbook_and_acls.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.57</id>
   
   <published>2009-04-17T03:37:44Z</published>
   <updated>2009-04-20T17:09:05Z</updated>
   
   <summary>Update: Apple Enterprise Support suggested a modification to the /etc/smb.conf file that seems to have addressed this problem. Citing this entry in the Samba man page the suggestion is to append &quot;nt acl support = no&quot; at the very end...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[<strong>Update:</strong> <em>Apple Enterprise Support suggested a modification to the /etc/smb.conf file that seems to have addressed this problem.  Citing this entry in the Samba<a href="http://us1.samba.org/samba/docs/man/manpages-3/smb.conf.5.html"> man page</a> the suggestion is to append "nt acl support = no" at the very end of this conf file. Ours now looks like this:</em>

<div class="codeblock">; Site-specific parameters can be added below this comment.&nbsp;&nbsp;&nbsp;<br/>
; END required configuration.

[global]
&nbsp;&nbsp;&nbsp;use kerberos keytab = yes
&nbsp;&nbsp;&nbsp;realm = stanford.edu
&nbsp;&nbsp;&nbsp;veto files = /Thumbs.db/
&nbsp;&nbsp;&nbsp;veto files = /.DS_Store/
&nbsp;&nbsp;&nbsp;veto files = /.TemporaryItems/
&nbsp;&nbsp;&nbsp;log level = 1 
&nbsp;&nbsp;&nbsp;nt acl support = no </div>

<em>You can also find more information by reading the authoritative <a href="http://www.samba.org/samba/docs/Samba3-HOWTO.pdf">Samba3-HOWTO.pdf</a> and review sections 16.4, 16.5.3-5 and 43.5 as they pertain to this configuration option.</em>


<strong>Original posting:</strong>

Here's something I've been chewing on that's alarming. There seems to be an exceptional issue with Microsoft Excel's "Share Workbook" feature while serving a spreadsheet on a Mac OS X Server via both AFP and CIFS.

In short, if a couple of users collaborate simultaneously on a spreadsheet, it will radically (and dangerously) alter your ACLs and POSIX-style permissions, irrespective of the parent folder's settings.

Here's how to reproduce this. Much of this is arbitrary for the sake of illustration, but it should be reproducible with other variables.]]>
      <![CDATA[

<strong>Step 1: Set up the shares, groups, perms</strong>

In Server Admin.app, create a network sharepoint called <em>Files</em> inside the /Groups directory (turn off the default sharing of the /Groups directory first&#8212;you shouldn't share with shares).  In Server Admin, enable the directory to be available via AFP and SMB. For SMB, do not enable oplocks or strict locking, and choose "Inherit permissions from parent."

In Workgroup Manager.app, create a group called <em>Bankers</em> and add a few user entities.  Let's say, <em>Binky</em>, <em>Sammy</em> and <em>Picky</em>. 

Give the Bankers group full control of the Files sharepoint using an access control list (ACL). And for the POSIX-style settings, set the the ownership to be  root:admin and set the the permissions set to 700.  For example:

<div class="codeblock">drwx------+  2 root  admin     68 Apr 16 21:18 Files</div>

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture1-87.html" onclick="window.open('http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture1-87.html','popup','width=904,height=740,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture1-thumb-250x204-87.png" width="250" height="204" alt="Picture1.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span>

It should look like this first image. 

Inside the Files sharepoint, create a folder called <em>Reports</em> using Server Admin. It should automatically inherit the same ownership, permissions and ACLs as the parent folder.

<strong>Step 2: Let's <em>Share This Workbook</em> to users</strong>

Let's ask Binky to connect to the Files sharepoint. Since he's in the Bankers group, he mounts the share on his Mac OS X 10.5.6 workstation. He creates an Excel spreadsheet using Excel 2008. We'll call that file <em>Budget.xlsx</em>.

While the spreadsheet is still open, Sammy, a Windows XP user with Excel 2007, also connects to the Files share and attempts to open and modify the file; as expected, he's thwarted. The file is in use. This is a good thing. But Microsoft has a better idea.

If you haven't used the "<a href="http://office.microsoft.com/en-us/excel/HP052025951033.aspx">Share Workbook</a>" feature, it's whole purpose is to allow groups of users to edit the same spreadsheet. Each member can open, modify, save and otherwise collaborate in real time, simultaneously. I never even knew that existed, to tell the truth.

So let's ask Binky to enable the Share Workbook feature from the Tools menu. Sammy can now open and modify the spreadsheet properly. Both Binky and Sammy are able to work together on this spreadsheet.

Now let's get Picky in on the action. From his Windows XP machine, he successfully attempts to open the budget.xlsx file and happily makes changes. The three users, Sammy, Binky and Picky, are now working simultaneously on the same file. The banking department is happy.

<strong>Step 3-A: Let's look closer (or, Where things get scary)</strong>

Unbeknown to the users, each time any of the users saves the file, the list of entities in the access control list begins to morph. Let's look at the second image, which illustrates what I'm talking about.

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture2-93.html" onclick="window.open('http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture2-93.html','popup','width=904,height=936,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture2-thumb-250x258-93.png" width="250" height="258" alt="Picture2.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span>

That's definitely not cool. You see how Server Admin shows rows and rows of the Bankers entity? That's not supposed to be there.  There are now multiple <em>Bankers</em> entities in the list. <em>Moreover, the POSIX permissions have now been set to 000</em>.  <em>This is not a visual anomaly in Server Admin.</em>

Let's have all the users quit Excel and we'll delete the budget.xlsx file.

<strong>Step 3-B: More changes!</strong>

Now let's change it so that the sharepoint Files has no ACLs at all. The owner and group will be root:bankers while the POSIX permissions are 770.  Let's make a daughter folder called something like <em>Stats</em>. It, too, is root:bankers and 770. All of our three users should be able to connect to Files share and work on documents in the Stats folder.

Let's ask Picky, our Windows XP user, to create a new spreadsheet FY09.xlsx and save it in the the Stats folder. Picky will also enable the Share Workbook feature.  Let's ask Sammy to open it. Ça marche &#8212;that works.  And now Binky, the Mac user, can also open and edit the file, too. Again, all three are working happily.

But let's go back and look at the file again. Now we see that there is now an Access Control List with the Bankers group as an entity! And the POSIX settings have been changed to 700 from 770. Remember we started this second example with no ACLs and 770 in the parent folders. See the third image.

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture6-99.html" onclick="window.open('http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture6-99.html','popup','width=904,height=740,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture6-thumb-250x204-99.png" width="250" height="204" alt="Picture6.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span>

<strong>Step 3-C: Another example of random behavior!</strong>

Let's ask everyone to close the FY09.xlsx file. This time, Binky, the Mac user, will create a new file FY10.xlsx and store it in the same Stats directory; he'll also enable the Share Workbook feature. Now when Picky, the PC user, attempts to open and edit it, he's alerted that the file is read only! The permissions of the Stats directory remain 770 with root:bankers and no ACLs. The new file has inherited that mode. He <em>should</em> be able to collaborate. Note the permissions, ACLs and ownership hasn't changed. Here, the Share Workbook feature doesn't work.

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture7-105.html" onclick="window.open('http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture7-105.html','popup','width=1360,height=902,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.stanford.edu/group/macosxsig/blog/assets_c/2009/04/Picture7-thumb-250x165-105.png" width="250" height="165" alt="Picture7.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span>

<strong>Postscript</strong>

This, unfortunately, persists even after users disconnect from the server, even if they reboot their workstations. I did not reboot the server in between examples. All the accounts are local to the server. None of the workstations are bound to any directories, either. The /etc/smb.conf file has not been modified. The server is freshly built with no third party software; it's running Mac OS X Server 10.5.6 and the clients are current with their patches and updates.  This is about as basic, fresh-from-the-factory as you can get.]]>
   </content>
</entry>

<entry>
   <title>ssh keys on Mac OS X Server: the fuller, longer, better instructions</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/03/this_turned_out_to_be.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.53</id>
   
   <published>2009-03-10T20:13:25Z</published>
   <updated>2009-04-16T16:42:24Z</updated>
   
   <summary>Establishing password-less logins using public/private keys turned out to be a bigger pain in the butt than I had expected. There are a lot of resources on the web on how to do this, typically for BSD or Linux; and...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="general" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[Establishing password-less logins using public/private keys turned out to be a bigger pain in the butt than I had expected. There are a lot of resources on the web on how to do this, typically for BSD or Linux; and there are even scripts that purport to do this with assistance, but only the simple part. Whenever I do this, I have to pause and give this more thought that should be necessary, <a href="http://tinyurl.com/c6cqdg">googlin' around</a> for an answer to solve what I screwed up.

The problems are, there are always other components at play which are Mac-specific, and the guides are usually generic or aimed at Linux, BSD or some other sort of unix-like operating system. Even Apple's own <a href="http://developer.apple.com/documentation/MacOSXServer/Conceptual/XServer_ProgrammingGuide/Articles/SSH.html">documentation</a> (from the Developer Connection, no less) is a little scant or can be intimidating for green sysadmins. This blog post is very long because it's very detailed. It's not quite step-by-step, but it's close.

<em>A note: if there's an omission or an error in the instructions, and thousands of credit card numbers, Social Security numbers, cancer test results or SAT scores escape into the open, don't come knocking on my door.</em>
]]>
      <![CDATA[Using password-less ssh sessions with public/private keys isn't recommended for daily use from user consoles (ie, a typical desktop computer). If your workstation is accessed without authorization, the keys to the kingdom belong to the crook. If you want the convenience of password-less ssh sessions, you should use Kerberos instead. At least with Kerberos authentication, someone, at some point, needs to provide Kerberos credentials prior the expiration period. Moreover, there are no files on the workstation to steal with Kerberos.  It's a good thing.

Most admins use pub/pri keys for mundane things, like automated rsyncing between two servers. There are, like everything else unix, many ways to skin a cat; but if done properly, you can do this in a reasonably secure way, with layers of security corresponding to your level of paranoia. In my case, to make things even more nerve-wracking, I'm using this for root-to-root ssh sessions. Call me crazy.   
<blockquote>Sidebar: An alternative method to all this is to use remctl <http://www.eyrie.org/~eagle/software/remctl/>. It's a Kerb5 alternative to pub/pri keys useful for issuing commands between two machines. It compiles cleanly on Mac OS X 10.5 with Xcode 3.1 &#8212; at least with version 2.12; however the current version at the time of this writing, 2.13, errors out on the <em>make</em>. My Mac servers use it for the sake of wallet <http://www.eyrie.org/~eagle/software/wallet/> but I should also take the time to learn about its magic first. </blockquote>
Also, be sure you have an out to get back in if you're working remotely, especially if the servers are headless and in a data center across campus. If you make some stupid typo, you won't be able to correct the situation &#8212; because you won't be able to shell in.  You can use Apple Remote Desktop if you like, but make sure you've already connected and you don't have the Encrypt All Network Data option enabled for that host. If I remember correctly, if you're connected via ssh and you make a change to its configuration file, your older settings apply until you reconnect. Or something like that.

Another thing to keep in mind is that Mac OS X doesn't actually have an always-running ssh daemon. It's an on-demand thing, kicked off by launchd (not xinitd or /etc/rc files).

<strong>The Gist: </strong>

This works by creating a set of keys on two machines (we'll call them "foo.stanford.edu" and "bar.stanford.edu" ) and swapping them so each server has set of private (its own) and public (the other) keys. You move the public key from one to the other, and vice-versa (because for our purposes, we want mutual, keyless ssh sessions from one to the other, and be able to reverse the process). Many instructions just end here, and when things just don't work, it's annoying. So let's take it from the top. Again, we're doing this to allow root-to-root ssh sessions. I told you this was scary. 

<u>Step 1:</u>

Ssh into foo using your typical admin account, in a typical fashion, then follow the example commands.  The process will ask a series of questions and even make a pretty picture for you.  Again, I'm logged into the server "foo" for the sake of demonstration. 

<div class="codeblock">[nbfa@foo 11:17:44 ~]$ sudo ssh-keygen -t dsa &nbsp;&nbsp;&nbsp;<br/>
Password: </div>

<em>Remember, my tutorial is for generating pub/pri keys for the root account, which is why I preface the do-ing command (ssh-keygen) with sudo. If you choose to run ssh-keygen as you, dear reader, you'll end up putting your keys in your own home directory. That's useful for other purposes, I'm sure. Also, the -t flag indicates "type" and we're using DSA encryption "just because". The alternative is RSA, and you're welcome, even encouraged to learn more by google-ing around. Using DSA vs RSA can be a contentious topic anywhere nerds congregate.</em>

<div class="codeblock">Generating public/private dsa key pair. <br/>
Enter file in which to save the key (/var/root/.ssh/id_dsa): /var/root/.ssh/foo_dsa&nbsp;&nbsp;&nbsp; </div>

<em>Here, I'm going to mitigate future confusion by not accepting the default name of id_dsa. I'm going to give it the name foo_dsa instead. This will change down the line, but it's helpful for moving across machines when the time comes.</em>

<div class="codeblock">Enter passphrase (empty for no passphrase):  &nbsp;&nbsp;&nbsp; <br/>
Enter same passphrase again:  <br/>
Your identification has been saved in /var/root/.ssh/foo_dsa. <br/>
Your public key has been saved in /var/root/.ssh/foo_dsa.pub. <br/>
The key fingerprint is: <br/>
88:c0:29:dc:4f:68:a0:1b:b7:fe:0d:37:63:00:86:85 root@foo.local <br/>
The key's randomart image is: <br/>
+--[ DSA 1024]----+ <br/>
| o.              | <br/>
|E+o..            | <br/>
|=.B+ .           | <br/>
| *.+o. .         | <br/>
|. . o.. S        | <br/>
| .   .           | <br/>
|  . . =          | <br/>
|   . = o         | <br/>
|    . .          | <br/>
+-----------------+ <br/>
[nbfa@foo 12:11:50 ~]$  <br/></div>


<em>All the rest is just confirmation and some random art thing someone thought was clever.</em>

<u>Step 2: </u>

Do the same thing on your other server. Rather than repeat myself, replace "foo" with "bar" from above. 

<u>Step 3:</u> (in easyland)

Since you're already on bar, we'll need to get the public key over to foo.  That sounds easy enough, but by default, you can's just scp it over as root, to root's home directory.  We can either make the adjustments in the other configuration files right now, or you can do something like put it on a thumb drive.  For the sake of simplicity, let's pretend you have a thumb drive, that foo and bar are ten feet away from your cubicle, attached to a KVM, and you have the key to open the server room. That's highly unlikely, I know. We'll get to alternatives later; this part is just for concept. 

Let's head over to foo first. Go ahead ahead and log in with your credentials and fire up Terminal and copy foo_dsa.pub over to your thumb drive. Don't try to use the Finder; beside, you'll get confused when you can't see the dot-ssh directory in root's home. 

<div class="codeblock"># sudo cp /var/root/.ssh/foo_dsa.pub /Volumes/mycheapthumbs &nbsp;&nbsp;&nbsp;</div>

Switch over to bar and do the same, transferring its .pub key to the thumb drive.  You now need to reverse the process by copying foo_dsa.pub over to bar, and then vice versa.  So in root's home directory, it should look like this: 

<div class="codeblock">[nbfa@bar 14:15:14 ~]# sudo ls -la /var/root/.ssh/&nbsp;&nbsp;&nbsp; <br/>
total 32 <br/>
drwx------   6 root  wheel   204 Mar  8 11:32 . <br/>
drwxr-x---  10 root  wheel   340 Nov 24 19:18 .. <br/>
-rw-r--r--   1 root  wheel   668 Mar  8 10:40 foo_dsa.pub <br/>
-rw-r--r--   1 root  wheel   622 Mar  8 10:40 bar_dsa.pub <br/>
-rw-------   1 root  wheel   622 Mar  8 10:40 bar_dsa <br/>
-rw-r--r--   1 root  wheel  3319 Mar  8 11:01 known_hosts <br/></div>

Looking at the above, we see bar's private key. This is really, really important and should be guarded with a rout of angry wolverines. Make sure the permissions are 600 (eg -rw------- ). The permissions are typically the default, but it's good to check it out. Follow these example commands for the server named bar, then do that for foo, too. 

<div class="codeblock">[nbfa@bar 14:15:14 ~] # sudo ls -la /var/root/.ssh/ <br/>
[nbfa@bar 14:15:14 ~]# sudo chmod 600 /var/root/.ssh/bar_dsa <br/></div>

The public keys are nothing special; they're public after all. 

Now jump to Step 4 below. 

<u>Step 3:</u> 

It's a good chance that you're no where near your server, or it's headless or locked away far from USB flash drives.  In this case, you'll have to scp (that's secure copy) the public keys from one server to the other. Most likely, however, you can't scp as root. (Don't fret; hold on a little bit longer.)  In fact, you can't even get to the /var/root/.ssh directory as yourself. To get around all this, you have to do the equivalent of three-point parallel park. First, sudo to root to copy your server's .pub file (just that server's) to your home directory. 

<div class="codeblock">[nbfa@foo 11:42:02 ~]# sudo cp /var/root/.ssh/foo_dsa.pub ~/Desktop/ &nbsp;&nbsp;&nbsp;</div>

Now, let's scp that key to your home directory on bar. You don't want to use sudo to scp it over, because that would really be root trying to connect to the other server (which is currently disallowed). 

<div class="codeblock">[nbfa@foo 11:45:16 ~/Desktop]$ scp foo_dsa.pub bar.stanford.edu:~/Desktop/ &nbsp;&nbsp;&nbsp;</div>

Ssh to bar to make sure you copied it on your other desktop. Finally, we'll copy the public key on our server's desktop over to its proper place, then change ownership and permission. 

<div class="codeblock">[nbfa@bar 11:48:18 ~/Desktop]$ sudo cp foo_dsa.pub /var/root/.ssh/ &nbsp;&nbsp;&nbsp; <br/>
[nbfa@bar 11:48:18 ~/Desktop]$ sudo chown root:wheel /var/root/.ssh/foo_dsa.pub <br/>
[nbfa@bar 11:48:18 ~/Desktop]$ sudo chmod 644 /var/root/.ssh/foo_dsa.pub <br/></div>

<u>Step 4:</u>

When we did all this moving around of public keys, we used names like foo_dsa.pub and bar_dsa.pub to keep things straight.  But these aren't really the normal names, so we'll have to change them to something expected. Technically you can use this custom name (foo or bar) but you'd have to edit a few other configuration files, and besides, you only get one public key file (though that file can have multiple server's keys concatenated).  You'd think that you would just change the name back to something.pub, but that would change that server's public key. Instead, we need to name it (or add to) authorized_keys2. Why the 2 in the name? Because we chose DSA as the encryption method, and that's what it likes. 

<div class="codeblock">[nbfa@foo 11:42:02 ~]# sudo mv /var/root/.ssh/bar_dsa.pub /var/root/.ssh/authorized_keys2 &nbsp;&nbsp;&nbsp;  </div>

If you've inherited a machine that already has one of these files, we'll just concatenate our other server's public key. 

<div class="codeblock">[nbfa@foo 11:42:02 ~]# sudo cat /var/root/.ssh/bar_dsa.pub >> /var/root/.ssh/authorized_keys2 &nbsp;&nbsp;&nbsp;</div>

Clean up after yourself and delete the public key sitting on your desktop (if only to reduce clutter and prevent future confusion).  Wash, rinse and repeat the other way around. 


<u>Step 5:</u>

Most of the work has been done, which is pretty awesome. At this point, you could try opening a sudo root shell and ssh-ing into the other server. 

<div class="codeblock">[nbfa@bar 11:45:22 ~/Desktop]$ sudo -s &nbsp;&nbsp;&nbsp;<br/>
Password: <br/>
[root@bar 11:54:07 ~/Desktop]#  <br/></div>

Then give it a whirl: 

<div class="codeblock">[root@bar 11:54:07 ~/Desktop]# ssh foo.stanford.edu &nbsp;&nbsp;&nbsp; <br/>
^C <br/>
[root@bar 11:54:07 ~/Desktop]# <br/>
Password: <br/></div>

If you are successful, hats off to you; go get a latte.  For the rest of us, it may just hang there, cursor blinking, mocking you until it eventually times out (or you type control-c) or it will prompt you for a password, which is what we were trying to avoid all along. The fun continues. 


<u>Step 6:</u> 

There are multiple points where this can fail; we'll enumerate a few. 

A) Check the firewall settings. You might have a local software or network-based firewall that prevents ssh connections. This is port 22 using TCP. 

B) You might not have the root account active. On Mac OS X Server, it's on by default (which is worrisome but convenient); the initial password is the same as the initial account when the server was configured. You can (and should) change the root account's password to something unique and super long and complicated, since you likely won't need to enter it very much (we use sudo and our own admin password to get our work done anyway). You can use Directory Access.app in the Utilities folder (or Workgroup Manager) to make the change to enable/disable/modify the root account.  Make sure it's alive, otherwise you can't ssh in. 

C) Your sshd_config file hasn't been modified. You need this edited from the default to make password-less root ssh-ing to happen.  Get out your Terminal and crack your finger knuckles, because we'll do some command line typing. You can use your favorite editor to make the changes. What? You don't have a favorite editor? Use nano then.  (As you would expect, this file is protected, so we need to use sudo again. If not, you'll probably do all these edits and then be told you can't save it. Rats.) This is where screwing up with typos can lock yourself out, so let's use caution and make a backup, just in case. 

<div class="codeblock">[nbfa@bar 11:48:18 ~/Desktop]$ sudo cp /etc/sshd_config /etc/sshd_config.org &nbsp;&nbsp;&nbsp; <br/>
[nbfa@bar 11:48:18 ~/Desktop]$ sudo nano /etc/sshd_config <br/></div>

This will open the ssh daemon configuration file. This is the config for the receiving ssh daemon, not the ssh command you initiate when you connect to a server.  It should look a little like this:  

<div class="codeblock">GNU nano 2.0.1 File: /etc/sshd_config &nbsp;&nbsp;&nbsp; <br/> # $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $ <br/># This is the sshd server system-wide configuration file.  See <br/>
# sshd_config(5) for more information. <br/># This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin <br/># The strategy used for options in the default sshd_config shipped with <br/># OpenSSH is to specify options with their default value where <br/># possible, but leave them commented.  Uncommented options change a <br/># default value. <br/>#Port 22 <br/>Protocol 2 <br/>#AddressFamily any <br/>#ListenAddress 0.0.0.0 <br/>#ListenAddress :: <br/><br/></div>

At the top of the text, where it says "See sshd_config for more information" means you can learn all about the different and fascinating variables and options you want ssh to assume when it responds to an incoming connection. It's rather confusion, because you think you're editing sshd_config, so what could you learn from by reading the file you're working on! What is not said is that you can read the manual for sshd_config and get the options and instructions there. Or you can google it. But let's open another terminal window and look at the man page. 


<div class="codeblock">[nbfa@bar 11:48:18 ~/Desktop]$ man sshd_config &nbsp;&nbsp;&nbsp; <br/>
SSHD_CONFIG(5) &nbsp;&nbsp;&nbsp; BSD File Formats Manual &nbsp;&nbsp;&nbsp;  SSHD_CONFIG(5) <br/>
NAME <br/> sshd_config -- OpenSSH SSH daemon configuration file&nbsp;&nbsp;&nbsp;<br/> SYNOPSIS <br/> etc/sshd_config <br/>
DESCRIPTION <br/> sshd(8) reads configuration data from /etc/sshd_config (or the file specified with -f on the command line).<br/> The file contains keyword-argument pairs, one per line. Lines starting with # and empty lines are interpreted as comments.&nbsp;&nbsp;&nbsp; <br/>Arguments may optionally be enclosed in double quotes (") in order to represent arguments containing spaces.&nbsp;&nbsp;&nbsp; <br/>The possible keywords and their meanings are as follows (note that keywords are case-insensitive and arguments are case-sensitive):&nbsp;&nbsp;&nbsp; <br/></div>

Scrolling down, we have an idea of what some defaults are and what some options are appropriate.  People can go nuts editing this file, and by default it's pretty secure; but let's stick to only a few changes for our purposes.  Going back to our terminal window with our text editor, lets scroll on down to make the changes.  We'll want these lines to look like this: 

<div class="codeblock">PermitRootLogin without-password (This limits the root<br/>account to using public/private keys or Kerberized ssh sessions.) &nbsp;&nbsp;&nbsp; <br/>
RSAAuthentication no <br/>
DSAAuthentication yes  <br/>
PubkeyAuthentication yes <br/>
AuthorizedKeysFile .ssh/authorized_keys2 <br/></div>

D) Your server uses service access control lists (SACLs) and root isn't allowed to ssh in. See this Apple technote on the topic: <http://docs.info.apple.com/article.html?path=ServerAdmin/10.5/en/c2im11.html>. Be sure to add root (or the long name, System Administrator). 


Now let's try again. Ssh as root to the other server. If any of the letters above have been resolved, hip hip hooray. Oh, and another trick to debugging this is to use the -v flag so that your ssh command verbosely demonstrates what it's attempting to do. There's even -vvv for super-verbose. 


<em>Security Considerations:  </em>

The scope of this document doesn't really cover ssh best practices and doesn't include certain security measures that are important. Here are quick and cheap suggestions, though. 

Use the built-in firewall and/or a network-based firewall to exclude all the bad guys, especially the internet. Which is to say, allow only the hosts or a tiny subnet from which you will allow connections.  Consider only allowing connections from the VPN pool or yours and the other server's IP address. 

Modify the SACLs on Server Admin.app to only allow certain, trusted entities to ssh in. 

Use an assortment of allow and deny parameters in the sshd_config file. For example, AllowUsers or AllowGroups effectively denies those not deliberately added. You can even eliminate challenge/response by enabling the PasswordAuthentication to "no". That will allow only Kerberized and public/private keys. This was enabled for the root account only specifying "without-password" for the PermitRootLogin parameter above. 

In Workgroup Manager, eliminate the login shell variable for the user accounts you manage. In the account's "Advanced" tab, select "none" for the login shell. 

Hopefully you'll be able to get your work done now, perhaps using the root pub/pri keys to do things like rsync-ing files from a primary to backup server.]]>
   </content>
</entry>

<entry>
   <title>Presentation: Stanford iPhone - iStanford</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/02/presentation_stanford_iphone_i.html" />
   <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.51</id>
   
   <published>2009-02-19T23:01:20Z</published>
   <updated>2009-02-19T23:06:26Z</updated>
   
   <summary>This is a presentation here on campus, Friday, February 20, 2:00-3:30 p.m. PRESENTERS: - Aaron Wasserman &amp; Kayvon Beykpour, Terriblyclever.com - Wyn Davies, Apple DESCRIPTION: iStanford is a fully integrated suite of Stanford services exclusively for the iPhone and iPod...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="general" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="iphone" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[This is a presentation here on campus, Friday, February 20, 2:00-3:30 p.m.

<strong>PRESENTERS: </strong>
- Aaron Wasserman & Kayvon Beykpour, Terriblyclever.com 
- Wyn Davies, Apple

<strong>DESCRIPTION</strong>:
iStanford is a fully integrated suite of Stanford services exclusively for the iPhone and iPod Touch. The suite allows users to access Stanford's directory, campus maps, course bulletin, events calendar, and athletic news, schedules and scores.

Since its release to the public, there has been nearly three times as many downloads of iStanford as there are registered iPhones on campus. On average, users spend around five minutes per session, and some of the most popular features include "Find Me" in Maps, and searching for a person in the directory.]]>
      <![CDATA[Aaron Wasserman and Kayvon Beykpour of Terriblyclever.com are both in their Junior year at Stanford, and have both worked on designing Stanford iApps.

More information can be found at <a href="http://stanford.terriblyclever.com/">http://stanford.terriblyclever.com/</a> 

<strong>About the presenters:</strong>

<u>Aaron Wasserman</u>
Aaron is one of the managing partners of Terriblyclever Design. He is also currently in his junior year at Stanford, pursuing a major in Economics. Since joining Terriblyclever, Aaron has helped oversee the sales and marketing efforts of "iStanford" to universities across the country.

<u>Kayvon Beykpour</u>
Kayvon is the CEO and co-founder of Terriblyclever Design. Since founding the company in the summer of 2007, Kayvon has committed his time both to the engineering and business sides of the company, and spearheaded Terriblyclever's transition into the mobile technology industry. Kayvon is also a junior at Stanford, pursuing a major in Computer Science.  

<strong>LOCATION:</strong> 
Turing Auditorium (Polya Hall, Room 111)
(<a href="http://campus-map.stanford.edu/index.cfm?ID=14-160">http://campus-map.stanford.edu/index.cfm?ID=14-160</a>)

<HR width="50%" align="left">

Tech Briefings are intended for power users, Expert Partners, and those with IT responsibilities, but open to everyone - faculty, staff, and students - and no registration required. This is your opportunity to get technology updates from, and ask questions of subject-matter experts.

To see the latest schedule as it's posted, go to http://techbriefings.stanford.edu.

To subscribe to an RSS feed with the latest information on Winter Tech Briefings, point your RSS reader/browser/catcher to: <a href="http://techbriefings.stanford.edu/techbriefing-winter2009.xml">http://techbriefings.stanford.edu/techbriefing-winter2009.xml</a>

<HR width="50%" align="left">

For more information, visit the Tech Briefing web site at <a href="http://techbriefings.stanford.edu/">http://techbriefings.stanford.edu/</a>, or contact Technology Training at (650) 723-4391.]]>
   </content>
</entry>

<entry>
   <title>FTP anonymous only, no account holders please</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2008/11/ftp_anonymous_only_no_account.html" />
   <id>tag:www.stanford.edu,2008:/group/macosxsig/blog//1.49</id>
   
   <published>2008-11-20T23:09:29Z</published>
   <updated>2008-11-20T23:47:13Z</updated>
   
   <summary>I had a client request an anonymous FTP service be configured on their Leopard server. I did this, but had a concern that users with accounts on the server might try to connect. This would be highly undesirable; FTP as...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="85" label="anonymous access" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="87" label="ftp" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="81" label="SACL" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      I had a client request an anonymous FTP service be configured on their Leopard server. I did this, but had a concern that users with accounts on the server might try to connect. This would be highly undesirable; FTP as we all know, is an insecure protocol.  So how to allow anonymous access only, but deny account holders with valid credentials?
      <![CDATA[I tried to configure the /Library/FTPServer/Configuration/ftpusers and ftpaccess files, but that didn't seem to work. And accounts, actually, are not local to the machine; they're <strike>pulled</strike> referenced from an external OpenLDAP directory. It seems that <a href="http://freshmeat.net/projects/tnftpd">tnftpd</a> is not clever enough to pay attention to local Open Directory groups populated with entities from external directory systems.

I thought I could do something clever with SACLs, but it's either <em>allow</em> or <em>deny-by-implication</em> &#8212;that is, if I allow everyone access to FTP, as is necessary in this situation, I can't explicitly exclude members of the staff. SACLs don't have a "deny" function (at least as far as I can tell).

Then I thought about adding ACLs to the sharepoints, but again, I can't put people in a deny group called "no_ftp_people" and put the same people in an allow group "access_via_afp". Besides, that's a lot of group management fuss, even with nesting.

Forget about using TCPWrappers and deny 171.64.0.0/14 or using ipfw &#8212;there are some users on campus who need anonymous access.

Finally, it dawned on me. I had tried to make a Kerberized FTP service before (and gave up). If I could set the required authentication to Kerberos, all account holders would fail. Only anonymous read-only access would be allowed, and no passwords sent over the tubes.

(Eventually, I want to figure out how to use an external KDC keytab with an FTP service principle on a Mac server, but that's for another day.)]]>
   </content>
</entry>

<entry>
   <title>How to properly remove the Zimbra iSync Connector</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2008/10/howto_uninstall_zimbra_isync_connector.html" />
   <id>tag:www.stanford.edu,2008:/group/macosxsig/blog//1.47</id>
   
   <published>2008-10-02T16:18:43Z</published>
   <updated>2008-10-02T18:10:42Z</updated>
   
   <summary>This entry is about the Zimbra iSync Connector, which is used to synchronize data from an iSync-compatible device and a Mac (plus other data stores, such as the computers associated with one&apos;s MobileMe account). Instead of using the Zimbra iSync...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="general" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="iphone" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="zimbra" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[This entry is about the <a href="http://www.zimbra.com/docs/ne/latest/zcs_connector_for_apple_isync_guide/">Zimbra iSync Connector</a>, which is used to synchronize data from an iSync-compatible device and a Mac (plus other data stores, such as the computers associated with one's MobileMe account). 

Instead of using the Zimbra iSync Connector, I had decided I wanted to use Zimbra's over-the-air notification system to keep my <a href="http://www.apple.com/iphone/enterprise/integration.html">iPhone</a> in sync. Since Zimbra and Apple have incorporated Microsoft's <a href="http://en.wikipedia.org/wiki/ActiveSync">ActiveSync</a> technology, I get email and calendar notifications, more-or-less instantly, without having to attach via USB; addresses are kept in sync this way, too. And since these two methods could compete against each other, I needed to remove the iSync Connector PreferencePane from my system. 

Normally, just dragging PreferencePanes to the trash would do the trick&#8212;but this wasn't effective.  Looking at /var/log/system.log, I was seeing lots of these entries on my Mac Pro running Mac OS X 10.5.5:
<div class="codeblock">Sep 30 13:21:30 beterouge ZimbraHelper[336]: An uncaught exception was raised
Sep 30 13:21:30 beterouge ZimbraHelper[336]: *** -[NSPlaceholderString initWithString:]: nil argument
Sep 30 13:21:30 beterouge ZimbraHelper[336]: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
Sep 30 13:21:30 beterouge ZimbraHelper[336]: Stack: (\n    2451677515,\n    2501561915,\n    2451676971,\n    2451677034,\n    2435643739,\n    52456,\n    72072,\n    9610,\n    9393\n)
Sep 30 13:21:30 beterouge com.apple.syncservices.SyncServer[229]: 2008-09-30 13:21:30.759 ZimbraHelper[336:10b] An uncaught exception was raised
Sep 30 13:21:30 beterouge com.apple.syncservices.SyncServer[229]: 2008-09-30 13:21:30.760 ZimbraHelper[336:10b] *** -[NSPlaceholderString initWithString:]: nil argument
Sep 30 13:21:30 beterouge com.apple.syncservices.SyncServer[229]: 2008-09-30 13:21:30.761 ZimbraHelper[336:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
Sep 30 13:21:30 beterouge com.apple.syncservices.SyncServer[229]: 2008-09-30 13:21:30.762 ZimbraHelper[336:10b] Stack: (
Sep 30 13:21:34 beterouge ReportCrash[342]: Formulating crash report for process ZimbraHelper[336]
Sep 30 13:21:35 beterouge ReportCrash[342]: Saved crashreport to /Users/nbfa/Library/Logs/CrashReporter/ZimbraHelper_2008-09-30-132130_beterouge.crash using uid: 501 gid: 20, euid: 501 egid: 20</div>

The problem was, I couldn't find <code>ZimbraHelper</code> on my system, so I couldn't get rid of this "process" that was crashing; this binary was part of the Zimbra iSync Connector PreferencePane that I had deleted, and an exhaustive search on my system revealed no such file.  I looked at the <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/bom.5.html">BOM file</a> for the iSync Connector installer to see what else might have been installed, but everything was contained in the PrefPane exclusively. What was going on?]]>
      <![CDATA[Searching through the Zimbra user forum showed a lot of <a href="http://www.zimbra.com/forums/isync-caldav/11598-how-uninstall-isync-connector.html">obsolete instructions</a>. Eventually, there was a more <a href="http://www.zimbra.com/forums/isync-caldav/17547-zimbrahelper-use-90-cpu-power.html">recent entry</a> relating to a different issue about CPU usage. The fix for SyncServices crashing and that fellow's problems are the same.

I needed to re-install the Zimbra iSync Connector, then use Terminal to remove it properly. Via the command line, enter this command, all on one line: <div class="codeblock">sudo /Library/PreferencePanes/Zimbra.prefPane/Contents/Resources/ZimbraHelper --uninstall</div>

This will actually <em>unregister</em> your Zimbra iSync Connector from the consciousness of SyncServices, addressing this type of problem (and delete the PreferencePane, too, of course).]]>
   </content>
</entry>

<entry>
   <title>Stanford&apos;s CS dept to offer iPhone programming course</title>
   <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2008/07/stanfords_cs_dept_to_offer_iph.html" />
   <id>tag:www.stanford.edu,2008:/group/macosxsig/blog//1.45</id>
   
   <published>2008-07-24T19:20:31Z</published>
   <updated>2008-07-24T19:24:58Z</updated>
   
   <summary>As originally posted on TUAW, Stanford&apos;s Department of Computer Science is offering CS 193P this upcoming fall term. The course is titled &quot;iPhone Application Programming.&quot;...</summary>
   <author>
      <name>Noah Abrahamson</name>
      
   </author>
   
      <category term="general" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="learning opportunities" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="77" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="73" label="Stanford" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
      <![CDATA[As originally <a href="http://www.tuaw.com/2008/07/23/stanford-to-offer-iphone-programming-course/">posted</a> on TUAW, Stanford's <a href="http://cs.stanford.edu/">Department of Computer Science</a>
is offering CS 193P this <a href="http://cs.stanford.edu/courses/schedules/2008-2009.autumn.php">upcoming fall term</a>. The course is titled "iPhone Application Programming."]]>
      
   </content>
</entry>

</feed>
