When the telnet service is enabled on your Linux system, users who connect will generally be presented with a login: prompt requesting the name of a user on the host system. This is confusing, and often unnecessary since shell users are probably using ssh to log in. So ideally you want your telnet service to connect directly to the Citadel text client.
To achieve this effect, you must configure your telnetd to run the Citadel client instead of /bin/login.
Note: In all of the below examples, your telnet server is /usr/sbin/in.telnetd -- but on some systems it might be /usr/sbin/telnetd instead. Check to see which one you have and adjust these configurations accordingly.
If your system is running xinetd, the configuration will be found in /etc/xinetd.d/telnet. It might look something like this:
service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd server_args = -h -L /usr/local/citadel/citadel log_on_failure += USERID }
If your system is running inetd, edit /etc/inetd.conf and search for the telnet lines. Uncomment them if they are commented out. Change them to look like this:
telnet stream tcp4 nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd -h -L /usr/local/citadel/citadel telnet stream tcp6 nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd -h -L /usr/local/citadel/citadel
If you have systemd you can listen for telnet connections without an inetd/xinetd superserver. Be aware that this may not work well on high-volume systems, though.
Create a file /etc/systemd/system/telnet.socket with the following contents:
[Unit] Description=Telnet Server [Socket] ListenStream=23 Accept=yes [Install] WantedBy=sockets.target
Then create a file /etc/systemd/system/telnet@.service (the @ is not a typo) containing:
[Unit] Description=Telnet Server [Service] ExecStart=/usr/sbin/telnetd -h -E /usr/local/citadel/citadel StandardInput=socket
Then enter these commands:
systemctl daemon-reload systemctl enable telnet.socket systemctl enable telnet.service systemctl start telnet.socket systemctl start telnet.service