使用场景:
客户端:嵌入式Linux网关 root@IoTP
服务器:阿里云服务器 root@VM_0_14_centos
服务器登录客户端

  1. 客户端运行
root@IoTP:~# ssh -K 30 -I 180 -y -g -f -N -T -R 211.159.189.50:55407:127.0.0.1:22 root@211.159.189.50

Host '211.159.189.50' key accepted unconditionally.
(ecdsa-sha2-nistp256 fingerprint md5 91:90:85:fd:b1:e0:90:33:38:b6:67:a9:92:82:c0:0e)
root@211.159.189.50's password: 
root@IoTP:~# 
  1. 服务器运行
[root@VM_0_14_centos zxzz]# netstat -anp | grep 55407
tcp        0      0 127.0.0.1:55407         0.0.0.0:*               LISTEN      11136/sshd: root    
[root@VM_0_14_centos zxzz]# ssh -p 55407 root@127.0.0.1
root@127.0.0.1's password: 
root@IoTP:~# ifconfig 
br-lan    Link encap:Ethernet  HWaddr F4:E1:1E:9C:54:9C  
          inet addr:192.168.188.1  Bcast:192.168.188.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29174 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4834 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1629080 (1.5 MiB)  TX bytes:203028 (198.2 KiB)

eth0      Link encap:Ethernet  HWaddr F4:E1:1E:9C:54:9C  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31964 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6230 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2313436 (2.2 MiB)  TX bytes:373800 (365.0 KiB)

eth1      Link encap:Ethernet  HWaddr F4:E1:1E:9C:54:9E  
          inet addr:192.168.3.29  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:841643 errors:0 dropped:36859 overruns:0 frame:0
          TX packets:38983 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:72265458 (68.9 MiB)  TX bytes:3794139 (3.6 MiB)

eth2      Link encap:Ethernet  HWaddr 1A:C6:A7:1B:A6:52  
          inet addr:10.149.66.69  Bcast:10.149.66.71  Mask:255.255.255.252
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:54 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17404 (16.9 KiB)  TX bytes:19756 (19.2 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2924 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2924 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:355778 (347.4 KiB)  TX bytes:355778 (347.4 KiB)

root@IoTP:~# 

输入嵌入式设备的密码即可进行远程访问。输入exit退出访问。

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐