OpenWrt allow Telnetl to coexist with ssh (dropbear)

Source: Internet
Author: User
Tags ssh dropbear

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.