ubuntu

Ubuntu中Telnet客户端有哪些常用命令

小樊
62
2025-04-17 09:09:58
栏目: 智能运维

在Ubuntu中,Telnet客户端(通常是通过telnet命令)用于远程连接到其他服务器。以下是一些常用的Telnet命令:

基本连接命令

  1. 连接到远程服务器

    telnet <服务器地址> <端口号>
    

    例如:

    telnet example.com 23
    
  2. 断开连接

    • 输入 quitexit
    • Ctrl+] 然后输入 quit
  3. 查看帮助信息

    • 输入 ?help

高级功能命令

  1. 设置超时时间

    set timeout <秒数>
    

    例如:

    set timeout 10
    
  2. 启用或禁用回显

    • 启用回显:
      set echo
      
    • 禁用回显:
      set noecho
      
  3. 设置本地端口转发

    open <本地端口>
    

    例如:

    open 8080
    
  4. 关闭本地端口转发

    close <本地端口>
    

    例如:

    close 8080
    
  5. 查看当前连接状态

    • 输入 status

示例会话

以下是一个简单的Telnet会话示例:

$ telnet example.com 23
Trying xxx.xxx.xxx.xxx...
Connected to example.com.
Escape character is '^]'.
login: your_username
Password: your_password
Last login: Thu Apr 14 12:34:56 2023 from your_ip_address.
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-42-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

systemd 245 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GPT +BLKID +ELFUTILS +KMOD +ID_EMACS)

* Documentation:  https://www.freedesktop.org/wiki/Software/systemd/
* Main documentation: https://www.freedesktop.org/wiki/Software/systemd/
* Log files:        /var/log/syslog
                    /var/log/auth.log
                    /var/log/kern.log
                    /var/log/dmesg

System information as of Thu Apr 14 12:34:56 UTC 2023

System load:  0.01               Processes:           146
Usage of /:   13.5% of 229.03GB   Users logged in:     1
Memory usage: 35%                 IP address for eth0: 192.168.1.100
Swap usage:   0%

=> There are 3 zombie processes.

* Super-optimized for small spaces - read how we shrank the memory
  footprint of MicroK8s to make it the smallest full K8s around.

  https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be installed immediately.
0 of these updates are security updates.

Last login: Thu Apr 14 12:34:56 2023 from your_ip_address

root@your_server:~#

注意事项

希望这些信息对你有所帮助!如果有其他问题,请随时提问。

0
看了该问题的人还看了