Difference between revisions of "Telnet"
From ArmadeusWiki
m (→Host) |
(cleanup) |
||
Line 4: | Line 4: | ||
==Installation== | ==Installation== | ||
− | Telnet client and server are installed by default on the standard Armadeus rootfs | + | Telnet client and server are installed by default on the standard Armadeus rootfs (included in Busybox), but requires some configuration: |
− | As it's not a good idea to log in as root through Telnet, create a user that you will use when connecting: | + | |
+ | ===User account creation=== | ||
+ | * As it's not a good idea to log in as root through Telnet, create a user that you will use when connecting: | ||
<pre class="apf"> | <pre class="apf"> | ||
# adduser guest | # adduser guest | ||
+ | |||
Changing password for guest | Changing password for guest | ||
New password: | New password: | ||
Line 14: | Line 17: | ||
</pre> | </pre> | ||
− | == | + | ===Start script=== |
− | + | * Telnet server (''telnetd'') is launched by ''inetd'' when someone is trying to access port 23. This behaviour can be configured in ''/etc/inetd.conf'': | |
− | Telnet server (''telnetd'') is launched by ''inetd'' when someone is trying to access port 23. This behaviour can be configured in ''/etc/inetd.conf'': | + | |
<pre class="apf"> | <pre class="apf"> | ||
# cat /etc/inetd.conf | # cat /etc/inetd.conf | ||
Line 22: | Line 24: | ||
</pre> | </pre> | ||
− | If so you just have to launch ''inetd'' daemon at the start of your system. You can for example add the following script on your APF as ''/etc/init.d/S60inetd'' (for convenience, a copy of this script can be found in ''target/scripts/'') : | + | * If so you just have to launch ''inetd'' daemon at the start of your system. You can for example add the following script on your APF as ''/etc/init.d/S60inetd'' (for convenience, a copy of this script can be found in ''target/scripts/'') : |
<source lang="bash"> | <source lang="bash"> | ||
Line 71: | Line 73: | ||
</source> | </source> | ||
+ | * '''be sure that ''/etc/inet.d/S60inetd'' has executable rights !''' Otherwise: | ||
+ | <pre class="apf"> | ||
+ | # chmod a+x /etc/inet.d/S60inetd | ||
+ | </pre> | ||
+ | |||
+ | ==Usage== | ||
===Host=== | ===Host=== | ||
− | When you're sure that ''inetd'' is running on your target, launch the connection that way on your PC: | + | * When you're sure that ''inetd'' is running on your target, launch the connection that way on your PC: |
<pre class="host"> | <pre class="host"> | ||
$ telnet 192.168.0.10 | $ telnet 192.168.0.10 | ||
Line 83: | Line 91: | ||
armadeus login: guest | armadeus login: guest | ||
Password: | Password: | ||
+ | |||
$ uname -a (to check you're really on your board ;-) ) | $ uname -a (to check you're really on your board ;-) ) | ||
Linux armadeus 2.6.27.2 #1 PREEMPT Thu Dec 4 14:09:27 CET 2008 armv4tl unknown | Linux armadeus 2.6.27.2 #1 PREEMPT Thu Dec 4 14:09:27 CET 2008 armv4tl unknown |
Latest revision as of 15:43, 2 November 2011
From Wikipedia:
"Telnet (Telecommunication network) is a network protocol used on the Internet or local area network (LAN) connections. It was developed in 1969 beginning with RFC 15 and standardized as IETF STD 8, one of the first Internet standards. Typically, telnet provides access to a command-line interface on a remote machine.
The term telnet also refers to software which implements the client part of the protocol."
Installation
Telnet client and server are installed by default on the standard Armadeus rootfs (included in Busybox), but requires some configuration:
User account creation
- As it's not a good idea to log in as root through Telnet, create a user that you will use when connecting:
# adduser guest Changing password for guest New password: Retype password: Password for guest changed by root
Start script
- Telnet server (telnetd) is launched by inetd when someone is trying to access port 23. This behaviour can be configured in /etc/inetd.conf:
# cat /etc/inetd.conf 23 stream tcp nowait root /usr/sbin/telnetd telnetd -l /bin/login
- If so you just have to launch inetd daemon at the start of your system. You can for example add the following script on your APF as /etc/init.d/S60inetd (for convenience, a copy of this script can be found in target/scripts/) :
#! /bin/sh
[ -f /usr/sbin/inetd ] || exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
echo -n "Starting INET services: "
inetd
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/inet && echo "done"
;;
stop)
echo -n "Stopping INET services: "
killall inetd
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/inet && echo "done"
;;
status)
echo -n "INET services are: "
if [ -f /var/lock/subsys/inet ]; then
echo "running"
else
echo "not running"
fi
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload)
killall -HUP inetd
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|status|reload|restart}"
exit 1
esac
exit $RETVAL
- be sure that /etc/inet.d/S60inetd has executable rights ! Otherwise:
# chmod a+x /etc/inet.d/S60inetd
Usage
Host
- When you're sure that inetd is running on your target, launch the connection that way on your PC:
$ telnet 192.168.0.10 Trying 192.168.0.10... Connected to 192.168.0.10.
From here we do as if we were directly connected on the target:
Escape character is '^]'. armadeus login: guest Password: $ uname -a (to check you're really on your board ;-) ) Linux armadeus 2.6.27.2 #1 PREEMPT Thu Dec 4 14:09:27 CET 2008 armv4tl unknown