summaryrefslogtreecommitdiffstats
path: root/build_tools/clarch/larch/run/ssh_init
diff options
context:
space:
mode:
authorJames Meyer <James.meyer@operamail.com>2008-10-02 03:23:45 (GMT)
committerJames Meyer <James.meyer@operamail.com>2008-10-02 03:23:45 (GMT)
commit618d4ad515a93d1e48934be5846edd71270171ec (patch)
treea22a9294af81215d4a7b1053e5fdb4d746f39d41 /build_tools/clarch/larch/run/ssh_init
downloadlinhes_dev-618d4ad515a93d1e48934be5846edd71270171ec.zip
initital import
Diffstat (limited to 'build_tools/clarch/larch/run/ssh_init')
-rwxr-xr-xbuild_tools/clarch/larch/run/ssh_init18
1 files changed, 18 insertions, 0 deletions
diff --git a/build_tools/clarch/larch/run/ssh_init b/build_tools/clarch/larch/run/ssh_init
new file mode 100755
index 0000000..66a716f
--- /dev/null
+++ b/build_tools/clarch/larch/run/ssh_init
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+DESTDIR=$1
+echo
+echo "************** Generating ssh keys to ${DESTDIR}/etc/ssh **************"
+echo
+# ssh initialisation - done here so that it doesn't need to be done
+# when the cd boots
+if [ -x ${DESTDIR}/usr/sbin/sshd ]; then
+ # Do it on the newly built system, in case the host doesn't have ssh
+ mount --bind /dev ${DESTDIR}/dev
+ chroot ${DESTDIR} bin/sh -c "{\
+ /usr/bin/ssh-keygen -t rsa1 -N \"\" -f /etc/ssh/ssh_host_key >/dev/null;\
+ /usr/bin/ssh-keygen -t rsa -N \"\" -f /etc/ssh/ssh_host_rsa_key >/dev/null;\
+ /usr/bin/ssh-keygen -t dsa -N \"\" -f /etc/ssh/ssh_host_dsa_key >/dev/null;\
+ }"
+ umount ${DESTDIR}/dev
+fi