I has been using this simple trick/fix for a while to enable telnet on my routers by just replace a file content
just replace the /bin/login.sh content with this one.
#!/bin/sh
# Copyright (C) 2006-2011 OpenWrt.org
if ( ! grep -qs '^root:[!x]\?:' /etc/shadow || \
! grep -qs '^root:[!x]\?:' /etc/passwd ) && \
[ -z "$FAILSAFE" ]
then
echo "###################"
echo "### Ksr Box 1.0 ###"
echo "###################"
echo " "
cat /proc/sys/kernel/hostname
echo " "
echo " "
ssh 127.0.0.1
else
cat << EOF
=== IMPORTANT ===============================
Use 'passwd' to set your login password
this will enable telnet login with password
---------------------------------------------
EOF
exec /bin/ash --login
fi
edit the header in the ### to match your desired Hi message.
this basic fix basically self ssh the router itself asking for a password via telnet, if the password is correct, you can enter comands, else, you have to reconnect.
the bad thing is that it only ask for a password, instead for username and password.
but well, most attackers would focus on the root account anyway, so is not an issue for me
(Last edited by kasar on 13 Sep 2015, 22:17)