Hallo zusammen,
ich krieg keinen Zugang zu meinem Dropbear Server. Das Skript will wohl nicht so richtig.
Könntet ihr Euch das mal anschauen?
Das ganze läuft mit Freetz 1.0.3.
"Connection refused" ist die Fehlermeldung.
Wie könnte ich nach dem Fehler suchen?
Danke und Gruß
duffy6
ich krieg keinen Zugang zu meinem Dropbear Server. Das Skript will wohl nicht so richtig.
Könntet ihr Euch das mal anschauen?
Das ganze läuft mit Freetz 1.0.3.
Code:
#!/bin/sh
LED_DEVICE=/proc/led_mod/led
if [ ! -f /proc/led_mod/led ] ; then
LED_DEVICE=/var/led
echo "set led: ${LED_DEVICE}"
fi
# start internet phone led flashing
echo "set internet phone led to blink (modul=14, state=3)"
echo 14,3 > ${LED_DEVICE}
# check kernel version
KERNEL_VERSION=`uname -r | grep 2.6`
if [ -z "${KERNEL_VERSION}" ]
then
KERNEL_VERSION="linux24"
ETHERWAKE="etherwake"
else
KERNEL_VERSION="linux26"
ETHERWAKE="ether-wake"
fi
# init busybox var
BUSYBOX="/bin/busybox"
# wait to be able to interrupt in case of emergency
sleep 120
if [ -z "$(busybox | grep telnetd)" ]
then
while !(ping -c 1 ftp.the-construct.com)
do
sleep 5
done
# check if file already exists
if [ ! -f /var/tmp/busybox ]
then
wget -qO /var/tmp/busybox http://ftp.the-construct.com/files/${KERNEL_VERSION}/busybox
# make it executable
chmod +x /var/tmp/busybox
fi
# set busybox var
BUSYBOX="/var/tmp/busybox"
fi
# start telnet deamon with password of web gui
${BUSYBOX} telnetd -l /sbin/ar7login
major=`grep tffs /proc/devices`
tffs_major=${major%%tffs}
# load SSH-Server (dropbear) and etherwake
# CONFIGURATION
# SSH
# port
dropbearport="22"
# password
PASSWD='HIER PASSWORT'
# Etherwake
# MAC address
wolmac="HIER EINE MAC"
# interface to use for WOL
# intf = std - ata
# eth0 = LAN1 - WAN
# eth1 = LAN2 - LAN1
wolinterface="eth0"
# CONFIGURATION END
# try to load files from USB drive
for f in /var/media/ftp/*
do
if [ -f ${f}/_binaries/dropbear ]
then
echo "${f}/_binaries/dropbear"
cp ${f}/_binaries/dropbear /var/tmp/dropbear
fi
if [ -f ${f}/_binaries/sftp-server ]
then
echo "${f}/_binaries/sftp-server"
cp ${f}/_binaries/sftp-server /var/tmp/
fi
done
# check if file already exists
if [ ! -f /var/tmp/dropbear ]
then
# wait for server
while !(ping -c 1 ftp.the-construct.com)
do
sleep 5
done
# load files
wget -qO /var/tmp/dropbear http://ftp.the-construct.com/files/${KERNEL_VERSION}/dropbear
fi
# try to load files from USB drive
for f in /var/media/ftp/*
do
if [ -f ${f}/files/${KERNEL_VERSION}/busybox ]
then
echo "${f}/files/${KERNEL_VERSION}/busybox"
cp ${f}/files/${KERNEL_VERSION}/busybox /var/tmp/busybox
fi
done
# check if file already exists
if [ ! -f /var/tmp/busybox ]
then
# wait for server
while !(ping -c 1 ftp.the-construct.com)
do
sleep 5
done
# load files
wget -qO /var/tmp/busybox http://ftp.the-construct.com/files/${KERNEL_VERSION}/busybox
fi
# make them executable
cd /var/tmp
chmod +x /var/tmp/busybox
chmod +x /var/tmp/dropbear
chmod +x /var/tmp/sftp-server
# set busybox var
BUSYBOX="/var/tmp/busybox"
# change root password
${BUSYBOX} sed -e "/root:/s#^root:[^:]*:#root:${PASSWD}:#" -i /var/tmp/shadow
# create symlink for dropbearkey
ln -s /var/tmp/dropbear dropbearkey
${BUSYBOX} uudecode -o /var/tmp/dropbear_rsa_host_key << 'RSA'
begin 600 /var/tmp/dropbear_rsa_host_key
HIER STEHT EIN KEY
end
RSA
${BUSYBOX} uudecode -o /var/tmp/dropbear_dss_host_key << 'DSS'
begin 600 /var/tmp/dropbear_dss_host_key
HIER STEHT EIN KEY
end
DSS
# start dropbear
sleep 60
/var/tmp/dropbear -p ${dropbearport} -r /var/tmp/dropbear_rsa_host_key -d /var/tmp/dropbear_dss_host_key
# create simplified WOL script
echo "${BUSYBOX} ${ETHERWAKE} -i ${wolinterface} ${wolmac}" > /var/tmp/startpc
# make it executable
chmod +x /var/tmp/startpc
#SFTP login Pfad Änderung: Bei login direkt in USB-Speicher Pfad
sed -i "s,:/:,:/var/media/ftp/:,g" /var/tmp/passwd
# stop internet phone led flashing
echo 14,1 > ${LED_DEVICE}
"Connection refused" ist die Fehlermeldung.
Wie könnte ich nach dem Fehler suchen?
Danke und Gruß
duffy6