diff options
author | Maarten Vanraes <alien@mageia.org> | 2011-10-24 18:05:36 +0000 |
---|---|---|
committer | Maarten Vanraes <alien@mageia.org> | 2011-10-24 18:05:36 +0000 |
commit | b0cae796314f7c0ceda3d44f0fa74e55acd21b8b (patch) | |
tree | 0143632fd8b255c90fdb39a4b527f5dfeb81c820 /rescue/startssh | |
parent | 8b55d62379d30e5263c28604f229ec376a9fa72e (diff) | |
download | drakx-backup-do-not-use-b0cae796314f7c0ceda3d44f0fa74e55acd21b8b.tar drakx-backup-do-not-use-b0cae796314f7c0ceda3d44f0fa74e55acd21b8b.tar.gz drakx-backup-do-not-use-b0cae796314f7c0ceda3d44f0fa74e55acd21b8b.tar.bz2 drakx-backup-do-not-use-b0cae796314f7c0ceda3d44f0fa74e55acd21b8b.tar.xz drakx-backup-do-not-use-b0cae796314f7c0ceda3d44f0fa74e55acd21b8b.zip |
- add screen
- add dropbear
- add etc/shells
- add script that set password and start ssh server
Diffstat (limited to 'rescue/startssh')
-rwxr-xr-x | rescue/startssh | 18 |
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" |