Is there a HOWTO for sshd via launchd?

Hippo Man

Hippo Man
I'm running the following OS release on a MacBook Pro:

Darwin Kernel Version 8.8.2: Thu Sep 28 20:43:26 PDT 2006; root:xnu-792.14.14.obj~1/RELEASE_I386​

I'm looking to start up the ssh daemon ("sshd") using launchd, but I have been unable to get that daemon started. Is there a cookbook anywhere which lists the step-by-step instructions for starting sshd under my OS?

I am very experienced with Unix and Unix-like OS's (more than 20 years), and therefore, I don't need a Unix tutorial. However, launchd is new to me, and I'm looking for help in using this utility to cause sshd to start up autmatically and stay running on my OS X box.

Thanks in advance.
 
As an old unix guy I can commiserate but I also have to say I do not know. I just turned it on via system preferences, go to System Preferences -> Sharing and click on "Remote Login" this starts sshd via launchd.

Now, if you just want it on you could just leave it at that, if your real goal is to understand what is going on I would toggle it a couple of times and see what apple is writing themselves.

Hope that helps!
 
Thanks for this. Well, I overlooked "Remote Login", and once I enabled that, ssh started working.

I have read a number of launchd docs, and I have gone to the ones that you listed here that I hadn't seen yet. So at least I now kind of understand how to manage the .plist file.

However, there are some things that are easy to do under the standard Unix configuration of ssh that seem to be absent when using launchd.

For example, if I want ssh to listen to port 22 on all interfaces and port 8822 on only one of my interfaces, does anyone know how I do this via launchd? It's easy if I use the standard /etc/sshd_config file (assuming that one of my interfaces listens on 100.101.102.103):

Port 22
ListenAddress 0.0.0.0
ListenAddress 100.101.102.103:8822
... etc. ...​

Also, if I want sshd to listen on a non-standard port on all interfaces, does anyone know how to indicate that in the .plist file without adding a special entry for that port in /etc/services? In other words, I can't use <string>8822</string> as an argument to the <SockServiceName> key. Instead, I have to put an entry like this in /etc/services:

otherssh 8822​

... and then set the <SockServiceName> to <string>otherssh</string>.

I'd like to just use a port number instead of fooling around with dummy entries in /etc/services. Is this possible?

Thanks in advance to any of you who might know the answers to these additional questions.
 
Back
Top