summaryrefslogtreecommitdiffstats
path: root/rescue/startssh
diff options
context:
space:
mode:
Diffstat (limited to 'rescue/startssh')
-rwxr-xr-xrescue/startssh18
1 files changed, 18 insertions, 0 deletions
diff --git a/rescue/startssh b/rescue/startssh
new file mode 100755
index 000000000..4c48d8291
--- /dev/null
+++ b/rescue/startssh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+passwd=`genpasswd`
+
+if (( $? != 0 )); then
+ reset
+ exit $?
+fi
+
+sed -E -i -e 's/^root:[^:]*:/root:'"$passwd"':/' /etc/passwd
+
+mkdir -p /etc/dropbear
+[[ -f /etc/dropbear/dropbear_dss_host_key ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
+[[ -f /etc/dropbear/dropbear_rsa_host_key ]] || dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
+
+echo ""
+echo -n "Starting ssh daemon... "
+dropbear && echo "OK"