OpenWrt let Telnetl and ssh (dropbear) coexist

Source: Internet
Author: User
Tags dropbear

Current Situation
OpenWrt Default user name is root, but the default is no password, so SSH is not turned on by default, but Telnet is used without password, when the root password is set, then ssh on, telnet off. And the convenience of SSH is more than telnet,telnet in the case of product testing and use, so there is no way to let the two coexist?

Step One
Modify the Telnet self-launch script to remove the 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 you to start Telnet when the/etc/init.d/telnet restart is executed, but you will be prompted for login when you connect faild

Step Two
The above connection error is shown in the/bin/login.sh script, open the file, delete the relevant judgment. Finally, leave one line of exec's line.
If you need to log in to the user name password when connecting to Telnet, change the last line to the following

exec /bin/login

In addition, by default, let the firmware enable SSH by default, set the default password method of firmware look at the blog:
http://blog.csdn.net/jk110333/article/details/8814675

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

OpenWrt let Telnetl and ssh (dropbear) coexist

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.