配置uClinux里的busybox中telnetd服务

本文详细介绍了一种在嵌入式系统中独立启动telnetd服务的方法,包括配置kernel、编译busybox、设置文件权限及目录等步骤,并提供了具体的命令示例。

启动 telnetd 服务一般有两种方式:

  • 通过inetd服务托管启动
  • 独立启动
通过inetd托管好像需要配置的文件比较多,所以这里选择独立启动方式。
1、 检查kernel配置,需选中"Device Drivers -> Character devices -> Unix98 PTY support"
2、 重新编译uClinux-dist里的busybox,需选中以下几项:
  • BusyBox -> Busybox Settings -> General Configuration  -> Use the devpts filesystem for Unix98 PTYs
  • BusyBox -> Login/Password Management Utilities -> login
  • BusyBox -> Networking Utilities -> telnetd
  • BusyBox -> Networking Utilities -> Support standalone telnetd (not inetd only)
  • 如果使用的是nommu板子(arm7),需要将"BusyBox -> Busybox Settings -> General Configuration  -> Path to BusyBox executable"选项的值设定为“/bin/busybox”

3、 添加group 和 passwd文件到romfs下的etc目录
  1. $ cat romfs/etc/group
  2. root::0:root
  3. $ cat romfs/etc/passwd
  4. root::0:0:root:/:/bin/sh

复制代码

4、 创建设备节点和目录

  1. $ cd romfs/dev/
  2. $ touch @ptmx,c,5,2
  3. $ mkdir pts

复制代码

5、 修改romfs/etc/rc,添加如下内容:

  1. mount -t devpts devpts /dev/pts

复制代码

6、 重新制作romfs.img,进入系统后通过命令:

  1. # telnetd

复制代码

启动telnetd服务。
启动时无需添加“&”, 因为它本身就是一个守护进程。
NOTE:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值