How to configure telnetd in busybox

Source: Internet
Author: User

Go to the busybox source code directory, select telnet, after telnetd.
Make sure that inetd and in. telnetd or telned exist in the sbin directory of ramdisk.
In the MNT/etc directory of ramdisk, ensure that the fstab, service, inetd. conf, and passwd files exist.
Make sure that the fstab file contains the line NONE/dev/PTS devpts mode = 0622 0 0.
Make sure the services file exists.
Telnet 23/tcp
Make sure that inetd. conf exists.
Telnet stream tcp Nowait root/sbin/in. telnetd in. telnetd
Make sure that the passwd file contains root: 0: 0: Root:/bin/sh, which indicates the root account without a password.
In the kernal code,
Select unix98 Pty support from character Devices
Select/dev/PTS File System for unix98 ptys in file systems.
Make zimage after exiting
In the ramdisk Startup File MNT/etc/init. d/RCs, add inetd to the next line after Mount-a to load the Telnetd Server when the system starts.

Create an inetd. conf file with the following content:
#
Telnetstream TCP Nowait root/usr/sbin/telnetd run inetd. conf on the Internet Google for a day, you can finally determine to use telnetd, the kernel must be configured with the following items:
Dev/PTS File System for unix98 ptys
Unix98 Pty support
(256) Maximum number of unix98 ptys in use (0-2048) can be used in the 2.6.14.1 kernel. Make menuconfig cannot find these configuration items! Does the Kernel support these options? CAT/proc/filesystems found that devpts file systems are supported. What about uinx98 Pty?
Check the kconfig and makefile files of the kernel and find that as long as config_unix98_ptys = Y, the system will compile and support the devpts file system and unix98 functions. If the embedded CPU kernel is selected, config_unix98_ptys = y is used by default. Therefore, my kernel supports Telnet.
The fstab file also loads the devpts File System:
Devpts/dev/PTS devpts defaults 00
The inittab file also specifies the Telnet action:
Tty0: askfirst:-/bin/sh
Why not? Confused! Later, I thought it was a problem with the file node of the device. I have never used devfs when porting the 2.6 kernel and driver on the Development Board. Although devfs is convenient, it also prevents the understanding of the file node of the device and the 2.6 kernel has abandoned devfs. What file nodes should be created using telnet? Devpts will automatically create nodes under/dev/pts. What else? Google has no answer after a while. Later, I suddenly remembered some instructions in the kconfig file, and then I checked it again. It turned out to be like this:
A Pseudo Terminal (Pty) is a software device consisting of two
Halves: a master and a slave. The slave device behaves identical
A physical terminal; the master device is used by a process
Read data from and write data to the slave, thereby emulating
Terminal. Typical programs for the master side are Telnet servers
And xterms. Linux has traditionally used the BSD-like names/dev/ptyxx
Masters and/dev/ttyxx for slaves of pseudo terminals. This scheme
Has a number of problems. The gnu c library glibc 2.1 and later,
However, supports the unix98 Naming Standard: in order to acquire
Pseudo Terminal, a process opens/dev/ptmx; the number of the pseudo
Terminal is then made available to the process and the pseudo
Terminal slave can be accessed as/dev/pts/. What was
Traditionally/dev/ttyp2 will then be/dev/pts/2, for example. It is because the ptmx device file is missing! Check the documentation/devices.txt file.
Mknod-M 666 ptmx C 5 2
Try again. OK, you can telnet the development board! I am using the telnetd of busybox directly. busybox supports using inetd to manage telnetd. If you are interested, try it.

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.