2024年4月1日发(作者:)
Telnet系列1:busybox telnetd的移植与配置
Telnet协议是登陆远程网络主机最简单的方法之一,只是安全性非常低。对target board来说,
必须执行telnet监控程序,这样才可以远程登陆到target board。同时,如果想从开发板通过telnet
远程登陆其他host,就需要具备telent client。
在嵌入式Linux系统上的telnet的工具有:
·telnet client
busybox telnet client。busybox本身就是为嵌入式系统量身打造,其telnet client精简,而
且比较好用。
·telnet server
主要有telnetd和utelnetd。就文件大小而言,utelnetd套件产生的二进制文件比telnetd要小,
但是utelnetd不支持internet super-server.下面先看busybox的telnet功能。client很简单,
选择上就可以用了;而telnetd则要相对麻烦一些。
Telnetd的移植倒不麻烦,busybox已经集成了一个。但是因为开始时配置出现问题,所以费了
些时间才算稳定。
(1)busybox的配置
对Telnetd的配置部分:
Networking Utilities --->
[*]telnetd
[*] Support standalone telnetd (not inetd only)
这个地方的配置说明,telnetd可以由inetd来启动,也可以standalone启动。
(2)编译之后,因为telnetd是busybox的一部分,我在编译busybox时采用了动态编译的方法,
所以只要把busybox依赖的动态库放到/lib下,就能保证telnetd不会产生找不到动态库的问题。所
以在make;make install之后,telnetd算是到了开发板上。但是仅仅这样还不能让telnetd正常
运行。参考配置telnetd时的help部分:
A daemon for the TELNET protocol, allowing you to log onto the host running the
daemon. Please keep in mind that the TELNET protocol sends passwords in plain
text. If you can't afford the space for an SSH daemon and you trust your network,
you may say 'y' here. As a more secure alternative, you should seriously consider
installing the very small Dropbear SSH daemon instead:
/dropbear/
Note that for busybox telnetd to work you need several things:
First of all, your kernel needs:
UNIX98_PTYS=y
DEVPTS_FS=y
Next, you need a /dev/pts directory on your root filesystem:
$ ls -ld /dev/pts
drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/
Next you need the pseudo terminal master multiplexer /dev/ptmx:
$ ls -la /dev/ptmx
crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx
Any /dev/ttyp[0-9]* files you may have can be removed.
Next, you need to mount the devpts filesystem on /dev/pts using:
mount -t devpts devpts /dev/pts
You need to be sure that Busybox has LOGIN and FEATURE_SUID enabled. And
finally, you should make certain that Busybox has been installed setuid root:
chown /bin/busybox
chmod 4755 /bin/busybox with all that done, telnetd _should_
对Linux内核的配置而言,默认已经满足。我出现错误主要是在mdev的初始化上,因为对mdev
不熟悉,导致在安排文件挂载顺序时不合理,总是提示找不到/dev/pts。对于mdev如何安排顺序,
应该看一下文档中的.
-------------


发布评论