summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-09-19 01:16:14 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-09-19 01:16:14 +0000
commit0f953a29d446ac2a772aa741ba72ef773f9b4c48 (patch)
treea34006dc532fdef4a42974725550bebbcbcb7a8a /etc
parente13383753016d29e5501f33da94fb55da16b8116 (diff)
downloadpfsense-0f953a29d446ac2a772aa741ba72ef773f9b4c48.zip
pfsense-0f953a29d446ac2a772aa741ba72ef773f9b4c48.tar.gz
* Create a /etc/keys_generating file incase a reboot occurs we know to start over.
* Cleanup some starting text * Add a blurb when we're generating keys to make startup text prettier
Diffstat (limited to 'etc')
-rwxr-xr-xetc/sshd58
1 files changed, 52 insertions, 6 deletions
diff --git a/etc/sshd b/etc/sshd
index a827fb3..c9d432c 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -77,6 +77,7 @@
$sshConfigDir = "/etc/ssh";
+ /* mop up from a badly implemented ssh keys -> cf backup */
if($config['ssh']['dsa_key'] <> "") {
unset($config['ssh']['dsa_key']);
unset($config['ssh']['rsa_key']);
@@ -88,20 +89,65 @@
write_config("Clearing SSH keys from config.xml");
}
- //if (!file_exists("$sshConfigDir/ssh_host_key") and $config['ssh']['dsa'] == "") {
- if (!file_exists("$sshConfigDir/ssh_host_key")) {
+ if (!file_exists("$sshConfigDir/ssh_host_key") or file_exists("/etc/keys_generating")) {
/* remove previous keys and regen later */
conf_mount_rw();
mwexec("rm /etc/ssh/ssh_host_*");
- echo "\n";
+ touch("/etc/keys_generating");
+ echo " Generating Keys:\n";
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa1 -N '' -f $sshConfigDir/ssh_host_key");
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa -N '' -f $sshConfigDir/ssh_host_rsa_key");
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t dsa -N '' -f $sshConfigDir/ssh_host_dsa_key");
-
+ unlink("/etc/keys_generating");
+ echo "Starting SSH... ";
}
- system("/usr/sbin/sshd");
- fwrite($stderr, "Done.\n");
+ $status = system("/usr/sbin/sshd");
+ if($status <> 0) {
+
+ } else {
+ echo "Done.\n";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
exit;
/* exit early, this needs more testing. */
OpenPOWER on IntegriCloud