Mac安装并使用telnet命令操作

热门精选文章,更多技术干货,微信搜索公众号【爱笑的架构师】,回复数字“666”,获取大量免费技术资料,都是经典中的经典:

自从mac系统升级后,就无法使用telnet,但使用ping有时又不够准确,因此寻找一些可以使用telnet的操作方式。

brew install telnet

在已安装brew的情况下,使用上述命令即可安装telnet,但我操作的时候有报错,报错信息如下:

> brew install telnet
Updating Homebrew...
Error: The following directories are not writable by your user:
/usr/local/sbin

You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/sbin

And make sure that your user has write permission.
  chmod u+w /usr/local/sbin

意思是将目录/usr/local/sbin的所有权修改为当前用户,直接在终端中输入如下命令:

sudo chown -R $(whoami) /usr/local/sbin

命令执行完成后再次执行第一步中的安装命令“brew install telnet”,即可以看到安装成功。安装成功的提示不一定需要和下图一模一样,可以看得出明显和出错时信息不一样。

安装完成后即可轻松的使用telnet命令啦,操作方式为telnet ip port。

【爱笑的架构师】属于程序员自己的圈子,微信扫描二维码关注,第一时间获取更多技术干货!

猜你喜欢

转载自blog.csdn.net/guoguo527/article/details/92810745