使用Holer外网SSH访问内网(局域网)Linux系统

1. Holer工具简介

Holer exposes local servers behind NATs and firewalls to the public internet over secure tunnels. 
Support forwarding message based on TCP protocol.

Holer是一个免费开源的内网穿透工具,它可以将局域网服务器代理到公网的内网穿透工具,支持转发基于TCP协议的报文。

Holer地址:https://github.com/Wisdom-Projects/holer

2. 使用Holer外网SSH访问内网(局域网)Linux系统

2.1.下载软件包并解压:

软件包地址:https://github.com/Wisdom-Projects/holer/tree/master/Binary

下载完ftp/sftp上传至内网(局域网)的Linux系统上

解压软件包: unzip holer-client.zip

2.2. 修改配置文件

vim holer-client/conf/holer.conf

公网和内网的地址映射关系

Holer Access KeyInternet AddressLocal Address
HOLER_CLIENT-822404317F9D8ADD holer.org:65534 127.0.0.1:22
     

内网(局域网)Linux的sshd 默认服务端口是22,选择记录里的Holer Access Key配置到holer-client/conf/holer.conf文件里

HOLER_ACCESS_KEY=HOLER_CLIENT-822404317F9D8ADD

2.3. 启动Holer服务

cd holer-client/bin

Linux系统执行启动Holer服务命令: sh startup.sh

如果需要停止Holer服务执行命令: sh shutdown.sh

2.4. 公网访问Linux系统

使用ssh客户端工具MobaXterm,输入如下命令就可以访问内网(局域网)的Linux系统了

ssh root@holer.org -p 65534

成功登录示例:

ssh root@holer.org -p 65534
root@holer.org's password:
[root@ip-172-31-19-0 ~]#
[root@ip-172-31-19-0 ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 172.31.19.0  netmask 255.255.240.0  broadcast 172.31.31.255
        inet6 fe80::56:7ff:fe0f:782  prefixlen 64  scopeid 0x20<link>
        ether 02:56:07:0f:07:82  txqueuelen 1000  (Ethernet)
        RX packets 88018  bytes 126478017 (120.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18631  bytes 1857449 (1.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 178  bytes 26469 (25.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 178  bytes 26469 (25.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


[root@ip-172-31-19-0 ~]#

  

posted @ 2018-05-06 18:30  千里驹  阅读(4126)  评论(2编辑  收藏  举报