From b0cae796314f7c0ceda3d44f0fa74e55acd21b8b Mon Sep 17 00:00:00 2001 From: Maarten Vanraes Date: Mon, 24 Oct 2011 18:05:36 +0000 Subject: - add screen - add dropbear - add etc/shells - add script that set password and start ssh server --- rescue/startssh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 rescue/startssh (limited to 'rescue/startssh') 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" -- cgit v1.2.1