Embedded Linux: Hardware, Software and Interfacing
Dr. Craig Hollabaugh
Running telnetd on the IP Engine
Configuration:
The IP Engine mounts its root filesystem using NFS.
The powerpc root filesystem exists in /tftpboot/powerpc-rootfs.
The cross-compiler powerpc-linux-gcc exists and compiles PowerPC code correctly.
(Basically you are beyond Chapter 5)
We are using the telnetd server called utelnetd from Pengutronix.
This project shows how to cross-compile and execute a telnetd server.
This project is for development only!
The telnetd server compiled here runs without any authentication! Do not deploy this project in production units without adding the login program for authentication.
Running utelnetd on the IP Engine Step 1 - Download and extract the utelnetd source code
cd /root/cross
wget http://www.pengutronix.de/software/utelnetd/utelnetd-0.1.1.tar.gz
tar zxvf utelnetd-0.1.1.tar.gz
Step 2 - Configure and cross-compile the utelnetd source code for the MPC823
cd utelnetd-0.1.1
CC=powerpc-linux-gcc make
Step 3 - Strip symbols from the telnet executable
ls -l utelnetd
-rwxr-xr-x 1 root root 30464 May 15 11:34 utelnetd*
powerpc-linux-strip -g utelnetd
ls -l utelnetd
-rwxr-xr-x 1 root root 15448 May 15 11:35 utelnetd*
Step 4 - Install utelnetd, configure and make device files
cd /tftpboot/powerpc-rootfs/sbin
cp /root/cross/utelnetd-0.1.1/utelnetd .
cd /tftpboot/powerpc-rootfs/dev
mknod ptyp0 c 2 0
chmod 0666 ptyp0
mknod ttyp0 c 3 0
chmod 0666 ttyp0
Step 5 - Start utelnetd
Run minicom and boot the RPX-CLLF
Notice that utelnetd is running /bin/sh for a login program. Our target doesn't have the /bin/login program.
This is a serious, very serious, security problem, as you will see in Step 6.
Step 6 - Test utelnetd
From tbdev1, telnet to the IP Engine
root@tbdev1[523]: telnet 192.168.1.22
Trying 192.168.1.22...
Connected to 192.168.1.22.
Escape character is '^]'.
stdin, stdout, etderr: 0 1 2
sh-2.04#
We are at the shell prompt on the IP Engine without any authentication!! This is a serious security concern
for your target board, don't deploy utelnetd in this fashion (without /bin/login). Add the cross-compiled /bin/login to add
the first level of authentication. login requires libcrypt, libpam and others to function properly.