1、执行以下命令,查看 telnet 客户端是否已安装:
# telnet localhost 22
若没有安装,会返回以下信息:
# telnet localhost 22
-bash: telnet: command not found
2、确认 telnet 命令是否存在:
# which telnet
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/tim/ ./local/bin:/home/tim/bin)
3、安装 telnet 客户端
# yum install telnet -y
4、如果 telnet 客户端安装成功,再次执行步骤1和步骤2,会返回以下信息:
# telnet localhost 22
Trying ::1...
Connected to localhost.
Escape character is '^]'.
# which telnet
/bin/telnet
PS. telnet 与 ping 的区别:
ping: 查看某一个ip地址是否能够连通,如: ping 202.89.233.103
telnet: 查看远程上的某一个端口是否可以访问,如:telnet 202.89.233.103 80
相关步骤执行快照: