Do the keys get generated automatically on boot, or something? Because the purpose of chrooting would be to run 'ssh-keygen -A', which (apparently) doesn't have the option to set an output file (edit: makes sense, given that it outputs multiple files
). I suppose you could always do:
$this->bbcode_second_pass_code('', 'mount /dev/sdX /mnt
ssh-keygen -t rsa -f /mnt/etc/ssh/ssh_host_rsa_key')
And so on (as well as whatever needs to be done for proper ownership of the keys). That might be whatcha gotta do if you don't have a second box to do the chroot on, anyway.
Also, any ideas on why the key files were empty?