Logging for SSHD when started from Launchd with `-d` option?
To add the -d argument to sshd, it should be added as a new element to the     array:

&lt;string&gt;-d&lt;/string&gt;


The section should look like:

&lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;-i&lt;/string&gt;
        &lt;string&gt;-d&lt;/string&gt;
    &lt;/array&gt;

Instead of editing the plist files directly, you can use /usr/libexec/PlistBuddy (-h to show help).
There is a utility script ssh-util.rb that can turn logging on/off. It is part of the OpenSSH-189 package found at: opensource.apple.com.

Link to ssh-util.rb

Here are the required commands to run (as produced from the ruby script):

/usr/bin/ruby ./ssh-util.rb -l on -v --debug --dryrun


or manually:

sudo /usr/libexec/PlistBuddy -c "add :ProgramArguments:2 string '-ddd'" /System/Library/LaunchDaemons/ssh.plist
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist
sudo touch /var/run/com.openssh.sshd-asl-enabled

When finished debugging,, you'll need to run either:

/usr/bin/ruby ./ssh-util.rb -l off -v --debug --dryrun 


or manually:

sudo /usr/libexec/PlistBuddy -c "Delete :ProgramArguments:2" /System/Library/LaunchDaemons/ssh.plist
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist
sudo rm -f /var/run/com.openssh.sshd-asl-enabled



Notes on OS X Logging