configure ssh launchctl I would like to configure sshd.

My ssh.plist

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
&lt;key&gt;Disabled&lt;/key&gt;
&lt;true/&gt;
&lt;key&gt;Label&lt;/key&gt;
&lt;string&gt;com.openssh.sshd&lt;/string&gt;
&lt;key&gt;Program&lt;/key&gt;
&lt;string&gt;/usr/libexec/sshd-keygen-wrapper&lt;/string&gt;
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;/usr/sbin/ssd&lt;/string&gt;
    &lt;string&gt;-i&lt;/string&gt;
    &lt;string&gt;-p 2222&lt;/string&gt;
    &lt;string&gt;-f /etc/sshd_config&lt;/string&gt;
&lt;/array&gt;
&lt;key&gt;Sockets&lt;/key&gt;
&lt;dict&gt;
    &lt;key&gt;Listeners&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;SockServiceName&lt;/key&gt;
        &lt;string&gt;ssh&lt;/string&gt;
        &lt;key&gt;Bonjour&lt;/key&gt;
        &lt;array&gt;
            &lt;string&gt;ssh&lt;/string&gt;
            &lt;string&gt;sftp-ssh&lt;/string&gt;
        &lt;/array&gt;
    &lt;/dict&gt;
&lt;/dict&gt;
&lt;key&gt;inetdCompatibility&lt;/key&gt;
&lt;dict&gt;
    &lt;key&gt;Wait&lt;/key&gt;
    &lt;false/&gt;
&lt;/dict&gt;
&lt;key&gt;StandardErrorPath&lt;/key&gt;
&lt;string&gt;/dev/null&lt;/string&gt;
&lt;key&gt;SHAuthorizationRight&lt;/key&gt;
&lt;string&gt;system.preferences&lt;/string&gt;





And the problem is with program arguments. When I reload configuration by running:

sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist


ssh is still listening on port 22.

What Am I doing wrong?
I have not tried this but I can see two possible issues


the arguments with spaces should be two arguments e.g. &lt;string&gt;-p 2222&lt;/string&gt; should be &lt;string&gt;-p&lt;/string&gt;&lt;string&gt;2222&lt;/string&gt;
From a the launchd.plist man page 



  This key maps to the second argument of execvp(3). ... Please note: many people are confused by this key. Please read execvp(3) very carefully!


the execvp(3) man page says that there arguments are filename, arg0, arg1,... and that arg0 is the name of the file so your first argument should be /usr/libexec/sshd-keygen-wrapper repeating Program.

A simpler way might be to remove Program altogether and only have ProgramArguments or just use Program and give the command as if typed into command line.

Another way of making this easy is use a GUI program like Lingon or LaunchControl