2

sslh的一个端口同时跑多个服务

 1 year ago
source link: https://bajie.dev/posts/20211110-sslh_multiple_port/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Sslh的一个端口同时跑多个服务

2021-11-10 1 分钟阅读

Ucloud的机器在两会期间干脆端口全灭,firewall设置进来的端口全关闭!!!!!!

还好有个Global ssh的服务,可以 ssh [email protected]

登录上去,注意,直接ssh [email protected] 是不通的。

那我们就搭建一个SSLH服务,可以把ssh和openvpn以及ssl服务统统塞到一个端口22里

1、修改openssh的端口 从22端口改成2222,千万别重启,22这会先得归ssh用

2、安装sslh

sudo apt install sslh
vi /etc/default/sslh

找到Run=no
改成Run=yes

然后到下面,按需配置(不跑443的话可以不配)
DAEMON_OPTS="--user sslh --listen 0.0.0.0:22 --ssh 127.0.0.1:2222 --ssl 127.0.0.1:443 --openvpn 127.0.0.1:1194 --pidfile /var/run/sslh/sslh.pid --timeout 5"

3、配置sslh并且重启服务器

sudo systemctl enable sslh
sudo reboot
fallback

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK