How to setup a telnet server for D3 on CentOS 7 and RHEL 7

If you want a telnet server that goes directly to D3, this article will help you. It is for CentOS 7 or RHEL 7 only.

Make sure you install telnet in Linux, first.

yum install telnet-server
yum install telnet

Start it to see if it works

systemctl start telnet.socket

Set a firewall rule to limit connecting only over the local network not the general Internet.
Also, limit the number of connections per minute to slow down any brute force attack.

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.0.0/16" service name="telnet" log prefix="telnet" level="info" limit value="10/m" accept'
firewall-cmd --reload
telnet localhost

Create an executable shell script to connect to the D3 database

vi /usr/bin/d3telnet
#!/bin/sh
exec d3 -n pick0 -dcdon

Make the above script executable

chmod 755 /usr/bin/d3telnet

Edit this file and add the phrase “-L /usr/bin/d3telnet” on the ExecStart line

vi /usr/lib/systemd/system/telnet@.service

[Unit]
Description=Telnet Server
After=local-fs.target

[Service]
ExecStart=-/usr/sbin/in.telnetd -L /usr/bin/d3telnet
StandardInput=socket

Restart the telnet server and try telnetting in directly to D3.

# systemctl restart telnet.socket