From 5c3ccc0dcf123ed41dcffc3df5405b2f0ba8d355 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 27 Jun 2009 16:54:04 -0400 Subject: Add ssh key support for nanobsd to preserve the ssh data --- etc/sshd | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'etc') 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 -- cgit v1.1