How to enable telnet server on macOS 10.13.1?

Solution 1:

Use ssh. Really - use ssh. But if you insist:

brew install telnetd

I'll leave this up since the typical homebrew services start script isn't implemented on the stable homebrew version. Once that's done, you can:

brew services start telnetd

The brew services needs a file like this in /usr/local/Cellar/telnetd/54.50.1/homebrew.mxcl.telnetd.plist and possibly the config file in /usr/local/etc/telnetd.conf or wherever.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>homebrew.mxcl.telnetd</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/sbin/telnetd</string>
    <string>--config</string>
    <string>/usr/local/etc/telnetd.conf</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>

Solution 2:

After installing telnetd with Homebrew, as you did, I was able to get it working with:

telnetd -debug [port]

where [port] is replaced with the number of the port on which you want to listen for incoming telnet connections.

By the way, you wrote that you located telnetd in the 'sbin' folder; you may also find a 'share' folder at the same level which contains a man page on telnetd. According to the man page, "[t]he -debug option may be used to start up telnetd manually, instead of through inetd."

Solution 3:

You can install telnet through brew as well. https://brewInstall.org is a webapp to search for a mac app and get the steps to install the app.

First install brewusing following command

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now install telnet using following command:

brew install telnet

Now to debug connectivity to an IP (for example 34.45.123.1) on port (9200), use the following command:

telnet 34.45.123.1 9200