Search code examples
macosterminaltelnetcisco-ios

make connection by telnet with mac osx sierra


I'm trying to connect to the cisco labs but I found that mac sierra no longer has the telnet client. The terminal error is as follows:

[Command not found: telnet]

[Could not create a new process and open a pseudo-tty.]

The first thing I did was install the latest version of xcode to then install telnet with homebrew but I still can not connect with the labs. Then I found a possible answer:

If you restore telnet via brew or something else you have to put the telnet application into the /usr/bin directory. If it isn't there the telnet URLs when calling terminal will be broken. However... the /usr/bin directory is locked with SIP (System Integrity Protection). You need to disable SIP in order to modify the /usr/bin directory. Reboot your mac... before the apple logo appears hit CMD+r. select "Utilities" then "Terminal". Type "csrutil disable" at the command line. then reboot normally. Place the telnet application in the /usr/bin directory. Then reenable SIP by doing the steps above but using "csrutil enable"

I followed the steps but I do not know exactly which file is the one that I need to move to usr / bin. I am not very expert in this topic so try to find the file with sudo find / -name telnet and find the following:

/usr/local/bin/telnet
/usr/local/var/homebrew/linked/telnet
/usr/local/opt/telnet
/usr/local/Cellar/telnet
/usr/local/Cellar/telnet/54.50.1/bin/telnet
/Library/Ruby/Gems/2.3.0/gems/net-telnet-0.1.1/lib/net/telnet
/Users/joseandradecruz/Library/Logs/Homebrew/telnet

I tried with the first file that is in usr/local/bin/telnet but it did not work


Solution

  • Once SIP is disabled, you can add a symlink to /usr/local/bin/telnet in /usr/bin/:

    sudo ln -s /usr/local/bin/telnet /usr/bin/
    

    You don't need to actually move telnet into the /usr/bin folder. The symlink provides access as if the file was there, for applications which don't have /usr/local/bin in the path.