Category Archives: Tips

Changing the sshd port in Mac OS 10.6

Starting with 10.4, Mac OS X has gradually moved to usingĀ launchd to control the stopping and starting of all core services. For someone used to configuring a Linux server, it required a little research to understand.

The default sshd configuration pulls the port information from /etc/services and sets up a listener on that port. The Sockets dictionary is used to let launchd know when to launch the service. The purpose of this system is to speed up the boot process by launching services on demand instead of automatically.

To change the sshd port as means of provide some additional security simply modify /System/Library/LaunchDaemons/ssh.plist and change SockServiceName from “ssh” to the port number you want sshd to use. You also have to modify the Port number in /etc/sshd_config to match the launchd configuration.

<key>Sockets</key>
 <dict>
 <key>Listeners</key>
 <dict>
 <key>SockServiceName</key>
 <string>40000</string>
 <key>Bonjour</key>
 <array>
 <string>ssh</string>
 <string>sftp-ssh</string>
 </array>
 </dict>
 </dict>

Subversion, Vendor Branches, and svn_load_dirs.pl

Yesterday, I started work on a project to upgrade the BU CMS to version 3.1.x of WordPress. We follow the vendor branch setup for handling vendor drops as suggested in the Subversion book. Unfortunately, Mac OS X Snow Leopard (10.6.6) does not ship with the additional subversion tools installed, specifically svn_load_dirs.pl. After doing a bit of hunting, I came across a support document for Drupal that pointed me in the right direction.

1. Download the source code for svn_load_dirs.

svn co http://svn.apache.org/repos/asf/subversion/tags/1.6.6/contrib/client-side/svn_load_dirs svn_load_dirs

2. Move svn_load_dirs.pl.in to a bin directory and rename to svn_load_dirs.pl.

mv svn_load_dirs/svn_load_dirs.pl.in ~/bin/svn_load_dirs.pl

3. Because we will not be building subversion from source, we need to edit the script and replace

my $svn = '@SVN_BINDIR@/svn';

with

 my $svn = '/usr/bin/svn';