summaryrefslogtreecommitdiffstats
path: root/etc/sshd
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-27 16:54:04 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-27 16:54:04 -0400
commit5c3ccc0dcf123ed41dcffc3df5405b2f0ba8d355 (patch)
tree374feab04c2d338e4d363fa52254d46a5c106f97 /etc/sshd
parent0fa9ebb1bfbcb1888df8784d04ccd1fbb1b8cfe4 (diff)
downloadpfsense-5c3ccc0dcf123ed41dcffc3df5405b2f0ba8d355.zip
pfsense-5c3ccc0dcf123ed41dcffc3df5405b2f0ba8d355.tar.gz
Add ssh key support for nanobsd to preserve the ssh data
Diffstat (limited to 'etc/sshd')
-rwxr-xr-xetc/sshd15
1 files changed, 12 insertions, 3 deletions
diff --git a/etc/sshd b/etc/sshd
index 0e351d1..23e5f0b 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -46,6 +46,13 @@
return $size;
}
+ /* restore ssh data for nanobsd platform */
+ if($g['platform'] == "nanobsd" and file_exists("/config/ssh/ssh_host_key")) {
+ if(!file_exists("/etc/ssh/sshd_host_key.pub")) {
+ cp("/config/ssh/* /etc/ssh/");
+ }
+ }
+
/* if any of these files are 0 bytes then they are corrupted.
* remove them
*/
@@ -173,9 +180,11 @@
}
// NanoBSD
- if(file_exists("/root/save_sshkeys"))
- exec("/root/save_sshkeys");
-
+ if($g['platform'] == "nanobsd") {
+ if(!is_dir("/config/sshd"))
+ exec("mkdir /config/sshd");
+ exec("cp /etc/ssh/ssh_host* /config/sshd");
+ }
conf_mount_ro();
?> \ No newline at end of file
OpenPOWER on IntegriCloud