diff --git a/src/etc/inc/plugins.inc.d/openssh.inc b/src/etc/inc/plugins.inc.d/openssh.inc index 33669ea60..50064ccd5 100644 --- a/src/etc/inc/plugins.inc.d/openssh.inc +++ b/src/etc/inc/plugins.inc.d/openssh.inc @@ -156,14 +156,20 @@ function openssh_configure_do($verbose = false) $sshconf .= "HostKey {$file}\n"; } - /* Write the new sshd config file */ file_put_contents("/usr/local/etc/ssh/sshd_config", $sshconf); - /* Launch new server process */ - echo "Reloading sshd..."; + if ($verbose) { + echo 'Configuring OpenSSH...'; + flush(); + } + if (mwexecf('/usr/bin/protect -i /usr/local/sbin/sshd')) { - echo "failed.\n"; + if ($verbose) { + echo "failed.\n"; + } } else { - echo "done.\n"; + if ($verbose) { + echo "done.\n"; + } } } diff --git a/src/etc/rc.sshd b/src/etc/rc.sshd index 0d975ce61..232f0efe4 100755 --- a/src/etc/rc.sshd +++ b/src/etc/rc.sshd @@ -4,7 +4,7 @@ /* * Copyright (C) 2004 Scott K Ullrich * Copyright (C) 2004 Fred Mol . - * Copyright (C) 2015-2016 Franco Fichtner + * Copyright (C) 2015-2017 Franco Fichtner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,4 +33,4 @@ require_once('config.inc'); require_once('util.inc'); require_once('plugins.inc.d/openssh.inc'); -openssh_configure_do(); +openssh_configure_do(true);