Current status
The default user name in OpenWrt is root, but the default is no password, so SSH does not open by default, but Telnet is used without password, when the root password is set, SSH is turned on, Telnet is closed. And the convenience of SSH is greater than telnet,telnet in the production and testing of the case to be used, so there is no way to let the two coexist.
Step One
Modify the Telnet self-boot script to remove password and SSH-related judgments, as follows
Start () {
# if (! Has_ssh_pubkey && \
# ! has_root_pwd/etc/passwd &&! has_root_pwd/etc /shadow) | | \
# (!/etc/init.d/dropbear enabled 2>/dev/null &&!/etc/init.d/sshd enabled 2>/dev/null);
# then
service_start/usr/sbin/telnetd-l/bin/login.sh
# fi
}
This allows telnet to be started in the execution of the/etc/init.d/telnet restart, but will find the connection prompt login Faild
Step Two
The connection error above is shown in the/bin/login.sh script, open the file, and delete the relevant judgment. The last line of exec was left.
If you need to connect to telnet with the login username password, change the last line to the following
Exec/bin/login
In addition, by default to enable SSH by default, set the default password method for the firmware See blog post:
http://blog.csdn.net/jk110333/article/details/8814675