T507-支持telnet 1. 下载编译源码 (1)进入T507开发环境,加载环境变量 forlinx@ubuntu:~/work/OKT507-linux-sdk$ source .buildconfig 或者 forlinx@ubuntu:~$ export PATH=/opt/Qt5.12/host/bin/:$PATH (2)可以创建一个工作目录,我这里下载了2.0版本的源码包 forlinx@ubuntu:~$ mkdir telnet && cd telnet forlinx@ubuntu:~/telnet$ wget https://ftp.gnu.org/gnu/inetutils/inetutils-2.0.tar.gz forlinx@ubuntu:~/telnet$ tar xvf inetutils-2.0.tar.gz forlinx@ubuntu:~/telnet$ cd inetutils-2.0/ (3)生成Makefile forlinx@ubuntu:~/ telnet/inetutils-2.0$ CC=aarch64-linux-gnu-gcc LDFLAGS=-static ./configure --disable-clients --disable-ipv6 --disable-ncurses --host=aarch64-linux-gnu --prefix=/ forlinx@ubuntu:~/ telnet/inetutils-2.0$ make 如果make时有如下报错 打开inetutils-2.0/ifconfig/system/linux.c 将PATH_PROCNET_DEV 全部替换为PATH_CONSOLE 然后再执行make 按照下面的方法把src/inetd和telnetd/telnetd拷贝到开发板 2. 开发板启动服务 (1)启动开发板,这里使用scp命令进行传输,需要提前配置好开发板ip(也可以用别的方式) root@forlinx:/# cd /usr/sbin/ root@forlinx:/usr/sbin# scp forlinx@172.20.2.127:/home/forlinx/telnet/inetutils-2.0/src/inetd ./ root@forlinx:/usr/sbin# scp forlinx@172.20.2.127:/home/forlinx/mygongju/telnet/inetutils-2.0/telnetd/telnetd ./ (2)配置启动telnet服务 #创建inetd的配置文件 root@forlinx:/# vi /etc/inetd.conf #添加以下内容: telnet stream tcp nowait root /usr/sbin/telnetd telnetd #运行inetd root@forlinx:/# chmod 777 /usr/sbin/inetd root@forlinx:/# inetd #查看服务运行状态 root@forlinx:/# netstat -a Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:9000 0.0.0.0:* LISTEN tcp 0 0 localhost:5037 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:www 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:ftp 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:telnet 0.0.0.0:* LISTEN tcp 0 0 :::ssh :::* LISTEN Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 3 [ ] DGRAM 9754 /dev/log unix 2 [ ACC ] STREAM LISTENING 3450 /var/run/dbus/system_bus_socket unix 2 [ ACC ] SEQPACKET LISTENING 1234 /run/udev/control unix 2 [ ACC ] STREAM LISTENING 9774 @jdwp-control unix 3 [ ] STREAM CONNECTED 9772 unix 3 [ ] STREAM CONNECTED 9775 unix 3 [ ] STREAM CONNECTED 1523 unix 3 [ ] DGRAM 1242 unix 3 [ ] STREAM CONNECTED 3272 unix 3 [ ] STREAM CONNECTED 8917 unix 3 [ ] STREAM CONNECTED 1494 unix 3 [ ] STREAM CONNECTED 9771 unix 3 [ ] STREAM CONNECTED 9776 unix 3 [ ] STREAM CONNECTED 8918 unix 3 [ ] STREAM CONNECTED 1495 unix 3 [ ] STREAM CONNECTED 1524 unix 2 [ ] DGRAM 8689 unix 3 [ ] STREAM CONNECTED 3271 unix 3 [ ] DGRAM 1243 可以看到telnet已经在LISTENING |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 11:24
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.