summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2008-11-23 03:47:32 (GMT)
committerJames Meyer <james.meyer@operamail.com>2008-11-23 03:47:32 (GMT)
commita73aa26202d19da424722bcf1285b566dbfd9d8d (patch)
treecc24843c13127ef3b5d8207aa7c82be0b1f00d37 /abs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run
parenta1219610c24fc89e2e4c1b81194fe25e40933cf5 (diff)
downloadlinhes_pkgbuild-a73aa26202d19da424722bcf1285b566dbfd9d8d.zip
linhes_pkgbuild-a73aa26202d19da424722bcf1285b566dbfd9d8d.tar.gz
linhes_pkgbuild-a73aa26202d19da424722bcf1285b566dbfd9d8d.tar.bz2
add mythvantage specific packages.
Diffstat (limited to 'abs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run')
-rwxr-xr-xabs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run20
1 files changed, 20 insertions, 0 deletions
diff --git a/abs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run b/abs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run
new file mode 100755
index 0000000..a019e5d
--- /dev/null
+++ b/abs/mv-core/runit-scripts-mv/runitscripts/services/sshd/run
@@ -0,0 +1,20 @@
+#!/bin/bash
+exec 2>&1
+nobodydir=/data/srv/.nobody_ssh
+
+[ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; }
+ [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; }
+
+if [ ! -f $nobodydir/id_dsa.pub ]
+then
+ mkdir -p $nobodydir
+ ssh-keygen -t dsa -N '' -f $nobodydir/id_dsa
+ mkdir -p /data/home/mythtv/.ssh
+ cp $nobodydir/id_dsa.pub /data/home/mythtv/.ssh/authorized_keys
+ chmod 700 /data/home/mythtv/.ssh/
+ chown -R mythtv:mythtv /data/home/mythtv/.ssh/
+fi
+chown -R nobody:nobody $nobodydir
+chmod 700 $nobodydir
+exec /usr/sbin/sshd -D >/dev/null 2>/dev/null