Configure openssh-server on Mac OS x10.9

Hello,


I want to install and configure 'openSSH-server' on Mac OS X 10.9


As I realized openSSH-server was preinstalled, and It runs:

"System Preferences" - "Sharing & Permissions" click on "Remote login".


Everything is fine, and if I want to change configuration I edit files:

/private/etc/sshd_condif — for ssh-Server.

/private/etc/ssh_condif — for ssh- client.


After that I want to do this using a console (terminal), and I had some troubles:

1) How to do start / stop / restart for sshd daemon (service) using a terminal?


It blew up my brain but I found that:


sshd starts here:

/usr/libexec/sshd-keygen-wrapper — it's a shell script, that creates keys for the server, and than runs:

exec /usr/sbin/sshd ssh-Server.


2)Config files are located in '../etc' , but I would put them to './etc/ssh/'

So, How to change path to config files? Should I 'make install' for bin file?


I see a solution that I don't like - change script '/usr/libexec/sshd-keygen-wrapper' to:

exec /usr/sbin/sshd -f /private/etc/ssh/sshd_condif.


Are there any other solutions?

MacBook Pro with Retina display, OS X Mavericks (10.9), for console (terminal) users

Posted on Nov 18, 2013 12:52 AM

Reply
3 replies

Nov 18, 2013 6:43 AM in response to BobHarris

thanks for you reply!



I've read a man page. I haven't understood how to restart or stop service (demon) sshd.



1) I want more than just Reread config, I want to start demon with config-file, that is located here:"./etc/ssh"

Or I need to run several SSH services... that's why I need to change default settings.


2) I want to understood how to control service from console(terminal). For unix I can use something like this:

"service sshd restart /stop / start"

or

"/etc/init.d/sshd restart /stop / start"

Nov 18, 2013 6:51 AM in response to AlexsandrShpet

AlexsandrShpet wrote:


1) I want more than just Reread config, I want to start demon with config-file, that is located here:"./etc/ssh"


That is a relative path. There is no "here" there.

2) I want to understood how to control service from console(terminal). For unix I can use something like this:

"service sshd restart /stop / start"

or

"/etc/init.d/sshd restart /stop / start"

OS X is UNIX. I believe you are referring to Linux.


OS X isn't the same. It may not even be running sshd. Launchd prefers to only start processes as they are needed. Are you running OS X server? You will have to change the launchd script to run sshd with your config file once you figure out where it is. Then unload and load the config script with launchctl.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Configure openssh-server on Mac OS x10.9

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.