I am doing a research on Telnet communication and I need to test its communication although it is not secure.
I have an Ubuntu machine 18.04 on my EC2 (I opened inbound port 23 for everyone in AWS).
I checked the status of the Telnet an it wasn't found:
root@ip:~# service telnet status Unit telnet.service could not be found. I tried to install it with the following commands
apt update apt --fix-broken install apt-get install xinetd telnetd After that I created the file /etc/xinetd.d/telnet with the information I found here:
service telnet { disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID } I tried to restart the service but it failed:
root@ip:~# service xinetd restart root@ip:~# service telnet restart Failed to restart telnet.service: Unit telnet.service not found. Any idea how to continue from here?
I checked the status of xinetd and it seems that the problem is that it uses the port 23 of telnet:
root@ip:~# service xinetd status ● xinetd.service - LSB: Starts or stops the xinetd daemon. Loaded: loaded (/etc/init.d/xinetd; generated) Active: active (running) since Thu 2021-02-18 16:25:05 UTC; 4min 7s ago Docs: man:systemd-sysv-generator(8) Process: 16422 ExecStop=/etc/init.d/xinetd stop (code=exited, status=0/SUCCESS) Process: 16492 ExecReload=/etc/init.d/xinetd reload (code=exited, status=0/SUCCESS) Process: 16428 ExecStart=/etc/init.d/xinetd start (code=exited, status=0/SUCCESS) Tasks: 1 (limit: 1140) CGroup: /system.slice/xinetd.service └─16455 /usr/sbin/xinetd -pidfile /run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6 Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: bind retry attempt 8 Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: bind failed (Address already in use (errno = 98)). service = telnet Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: bind retry attempt 9 Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: bind failed (Address already in use (errno = 98)). service = telnet Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: bind retry attempt 10 Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: bind failed (Address already in use (errno = 98)). service = telnet Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: Service telnet failed to start and is deactivated. Feb 18 16:27:18 ip-172-31-17-160 xinetd[16455]: Reconfigured: new=0 old=1 dropped=0 (services) Feb 18 16:27:18 ip-172-31-17-160 xinetd[16492]: ...done. Feb 18 16:27:18 ip-172-31-17-160 systemd[1]: Reloaded LSB: Starts or stops the xinetd daemon.. I changed the telnet port from /etc/services to 2345 and restart the xinetd service but it still show me (xinet -d) the same errors.