Mike's PBX Cookbook

macOS ftp/telnet/rlogin

Apple removed ftp, telnet, and rlogin in macOS High Sierra (10.13). Here's how to restore them.

Update:

Install Homebrew, followed by brew install inetutils
Homebrew is M1/M2 (Apple Silicon) compatible, inetutils includes: ftp, rcp, rexec, rlogin, rsh, telnet

Or, Serial includes comprehensive Telnet support, together with an SSH client and connection manager.

telnet:

To telnet to an MGC card, use: telnet <card-ip>

$ telnet 10.10.10.51
Trying 10.10.10.51...
Connected to 10.10.10.51.
Escape character is '^]'.

login: admin                                  ⇐ log in to mgc
password: 

The software and data stored on this system are the property of,
or licensed to, Avaya Inc. and are lawfully available only to
authorized users for approved purposes. Unauthorized access to
any software or data on this system is strictly prohibited and
punishable under appropriate laws. If you are not an authorized
user then logout immediately. This system may be monitored for
operational purposes at any time.

Welcome to the Media Gateway Controller command line.
Firmware Version: MGCCCD05
Management IP: 10.10.10.51
IPMG: 0 0
Primary CS IP Address: 10.10.10.5
Installed Daughterboards: 1
OS Created on: Date [Nov 16 2010] Time [12:07:40] 

oam> 

rlogin:

To rlogin to a CS1000, use: sudo rlogin CPSID@<server-ip>
Close the session with ~. (tilde, period). rlogin requires sudo.

$ sudo rlogin CPSID@10.10.10.5
Password:                                     ⇐ enter the macOS user password, due to sudo

SEC054 A device has connected to, or disconnected from, a pseudo tty without authentica
ting

TTY 01 SCH MTC BUG   12:25
OVL111 IDLE   0 
OVL111  TTY 03     43    ADMIN     
>logi admin                                   ⇐ log in to cs1000
PASS?
The software and data stored on this system are the property of,
or licensed to, Avaya Inc. and are lawfully available only to
authorized users for approved purposes. Unauthorized access to
any software or data on this system is strictly prohibited and
punishable under appropriate laws. If you are not an authorized
user then logout immediately. This system may be monitored for
operational purposes at any time.

OVL111 IDLE   0 
OVL111  TTY 03     43    ADMIN     
.
TTY #01 LOGGED IN ADMIN 12:25  24/6/2019 

>logo                                         ⇐ log out of cs1000

TTY #01 LOGGED OUT ADMIN 12:25  24/6/2019 
SESSION DURATION:  00:00 

>~.                                           ⇐ enter tilde+period to close session


Catalina / Big Sur Update:

When installing ftp_telnet_rlogin.zip, there are some newfangled security steps to negotiate!

1 Try and open, it fails. Goto System Preferences ➤ Security and click Allow Anyway.

2 Try to open it again, it still fails. Now in the dialog box, click Open.

Luckily, you'll only have to do this once!

Reminder: to toggle show/hide hidden files: ++. (command + shift + period)

Extended atributes: An @ sign in ls -l denotes the file has extended attributes

show extended attribute: ls -l -@ filename
show extended attributes: xattr filename
delete one extended attribute: xattr -d com.apple.quarantine filename
delete all extended attributes: xattr -c filename

HomeBrew:

Another (easiest) route is to install Homebrew: the Missing Package Manager for macOS (or Linux)!
Homebrew works with M1/M2 (Apple Silicon) Mac's, and is an easy way to get telnet with macOS Monterey.

The inetutils package includes: ftp, rcp, rexec, rlogin, rsh, telnet


Inetutils - GNU network utilities:

This procedure shows how to compile and install Inetutils on MacOS, which includes telnet and ftp.
It requires Apples Xcode, which will be automatically downloaded and installed if not already.

1 Download the latest version of Inetutils from: http://ftp.gnu.org/gnu/inetutils/ (eg. inetutils-1.9.4)
- Update: inetutils-2.0.tar.gz is available (2021-02-05)

2 If not already, unpack it with:

cd ~/downloads
tar xvjf inetutils-1.9.4.tar.gz

3 Change to the inetutils-1.9.4 folder with:

cd ~/downloads/inetutils-1.9.4

4 Configure the package options:

./configure --disable-servers --disable-dnsdomainname --disable-hostname --disable-ping --disable-ping6 --disable-rcp --disable-rexec --disable-rlogin --disable-rsh --disable-logger --disable-talk --disable-tftp --disable-whois --disable-ifconfig --disable-traceroute

5 Compile:

make

6 Copy the binaries to /usr/local/bin/ , for example:

sudo cp telnet/telnet /usr/local/bin/
sudo cp ftp/ftp /usr/local/bin/

7 Copy the man files to /usr/local/shared/man/man1 , as below:

mkdir /usr/local/share/man
mkdir /usr/local/share/man/man1
cp man/telnet.1 /usr/local/share/man/man1
cp man/ftp.1 /usr/local/share/man/man1

8 telnet and ftp should now be restored. For example:

$ telnet -V
telnet (GNU inetutils) 1.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by many authors.
$