Difference between revisions of "Telnet"

From ArmadeusWiki
Jump to: navigation, search
m (Target)
m
Line 6: Line 6:
 
Telnet client and server are installed by default on the standard Armadeus rootfs. (Included in Busybox).<br>
 
Telnet client and server are installed by default on the standard Armadeus rootfs. (Included in Busybox).<br>
 
As it's not a good idea to log in as root through Telnet, create a user that you will use when connecting:
 
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">
 
  # adduser guest
 
  # adduser guest
 
  Changing password for guest
 
  Changing password for guest
Line 11: Line 12:
 
  Retype password:
 
  Retype password:
 
  Password for guest changed by root
 
  Password for guest changed by root
 +
</pre>
  
 
==Usage==
 
==Usage==
 
===Target===
 
===Target===
 
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">
 
  # cat /etc/inetd.conf
 
  # cat /etc/inetd.conf
 
  23      stream  tcp    nowait  root    /usr/sbin/telnetd telnetd -l /bin/login
 
  23      stream  tcp    nowait  root    /usr/sbin/telnetd telnetd -l /bin/login
 +
</pre>
  
 
If so you just have to launch ''inetd'' at the start of your system. You can for example add the following script to ''/etc/init.d/'' :
 
If so you just have to launch ''inetd'' at the start of your system. You can for example add the following script to ''/etc/init.d/'' :
Line 69: Line 73:
 
===Host===
 
===Host===
 
When you're sure that ''inetd'' is running on your target, launch the connection that way:
 
When you're sure that ''inetd'' is running on your target, launch the connection that way:
 
+
<pre class="apf">
[ ]$ telnet 192.168.0.10
+
$ telnet 192.168.0.10
Trying 192.168.0.10...
+
Trying 192.168.0.10...
Connected to 192.168.0.10.
+
Connected to 192.168.0.10.
Escape character is '^]'.
+
Escape character is '^]'.
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
 +
</pre>
  
 
==Links==
 
==Links==

Revision as of 13:29, 16 February 2009

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).
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

Usage

Target

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 at the start of your system. You can for example add the following script to /etc/init.d/ :

#! /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

Host

When you're sure that inetd is running on your target, launch the connection that way:

$ telnet 192.168.0.10
Trying 192.168.0.10...
Connected to 192.168.0.10.
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

Links