On one of my Servers I needed access to a Port by different Services.
So, in my Case the Requirement was to use the Apache Webserver on
SSL Port 443 and to use SSH on the same Port.
In an earlier Article I wrote how to create an launchd Deamon to use SSH on Port 443.
The Problem is you can only bind one Port to an Service but you can bind
different Services to different IP-Addresses. Anyway, you need 2 IP-Addresses to work around this.
So, first I selected in Server Admin -> Web Service -> General an specific IP to use for the SSL Website
Next you have to edit the in an previous Article introduced ssh443.plist
You have to add these 2 Lines:
<key>SockNodeName</key>
<string>192.168.0.1</string>
The complete plist looks like this:
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>Label</key>
<string>com.openssh443.sshd</string>
<key>Program</key>
<string>/usr/libexec/sshd-keygen-wrapper</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/sshd</string>
<string>-i</string>
</array>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>Bonjour</key>
<array>
<string>ssh</string>
<string>sftp-ssh</string>
</array>
<key>SockNodeName</key>
<string>192.168.0.1</string>
<key>SockServiceName</key>
<string>ssh443</string>
</dict>
</dict>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>
Use ‘launchctl’ to load the Service:
launchctl load -w /Library/LaunchDaemons/ssh443.plist


