El protocolo Telnet (Telecommunicating Networks) permite abrir un shell en una máquina remota. Este procolo se implementa con arquitectura cliente-servidor, por lo que necesita:
- un servidor Telnet que se esté ejecutando en la máquina remota, y que por defecto, estará escuchando en el puerto 23 TCP.
- un cliente Telnet que nos permita conectarnos al servidor emulando un terminal que se encontrase físicamente conectado a él.
Si queremos habilitar el servidor Telnet (paquete telnetd) lo haremos por medio de inetd. Editaremos /etc/inetd.conf y añadiremos la línea:
telnet stream tcp nowait telnetd.telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd |
Atención
El servidor Telnet no debe utilizarse, ya que transmite los datos sin encriptar, habiendo sido sustituido por SSH, una versión encriptada de Telnet.
El comando telnet (paquete telnet) es un cliente Telnet. Su sintaxis es la siguiente:
$ telnet <direccion_host> [puerto] |
- <direccion_host> IP o nombre de la máquina remota.
- [puerto] por defecto utiliza el puerto 23 TCP.
Por ejemplo, para conectarnos al servidor Telnet de la máquina pc350 (por defecto puerto 23 TCP), haremos:
$ telnet pc350 Trying 192.168.1.3... Connected to pc350 Escape character is 'ˆ]' pc350 login: |
Para conectar con el router haremos:
$ telnet 192.168.1.1 Trying 192.168.1.1... Connected to 192.168.1.1 Escape character is '^]' Username: |
Lo primero que nos pide el sistema remoto es el login. Debemos introducir un nombre de usuario válido en el sistema remoto y su contraseña. Una vez logueados, tendremos acceso al sistema y podremos usarlo como si estuviéramos sentados allí, con los privilegios que tenga ese usuario.
Para obtener ayuda una vez conectados, generalmente alguno de los comandos help, ? o man nos dará información sobre los comandos disponibles:
> help Following commands are available : help : Displays this help information menu : Displays menu ? : Displays this help information exit : Exits this shell. saveall : Saves current configuration. ping : Send ICMP ECHO_REQUEST packets. traceroute : Send ICMP/UDP packets to trace the ip path. Following command groups are available : firewall service autopvc connection dhcp dns dsd dyndns eth adsl atm config debug env expr hostmgr igmp interface ip ipqos label language memm mlp nat ppp pptp script snmp sntp software system systemlog quit user |
Para cerrar la conexión con el sistema remoto ejecutaremos:
> quit |
O bien:
> exit |
o pulsaremos la secuencia de escape <Ctrl+]>
me saca este error al tratar de hacer telnet a un servidor, que puede ser.
muchas gracias
CYBA:/home/CarlosRedes # telnet -a 172.18.0.6 3299
Trying 172.18.0.6…
Connected to 172.18.0.6.
Escape character is ‘^]’.
NI_RTERR&*ERR*1connection timed out-5NI (network interface)70038nirout.cpp5441RTPENDLIST::timeoutPend: CONNECTED timeoutThu May 29 10:43:45 200859SAProuter 38.10 on ‘arcturus’*ERR*Connection closed by foreign host.