summaryrefslogtreecommitdiff
path: root/openwrt/package/openssh/files/S50sshd
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/package/openssh/files/S50sshd')
-rwxr-xr-xopenwrt/package/openssh/files/S50sshd15
1 files changed, 15 insertions, 0 deletions
diff --git a/openwrt/package/openssh/files/S50sshd b/openwrt/package/openssh/files/S50sshd
new file mode 100755
index 0000000000..bb23691954
--- /dev/null
+++ b/openwrt/package/openssh/files/S50sshd
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+for type in rsa dsa; do {
+ # check for keys
+ key=/etc/ssh/ssh_${type}_host_key
+ [ ! -f $key ] && {
+ # generate missing keys
+ [ -x /usr/bin/ssh-keygen ] && {
+ /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
+ } &
+ exit 0
+ }
+}; done
+
+/usr/sbin/sshd