加入收藏 | 设为首页 | 会员中心 | 我要投稿 西安站长网 (https://www.029zz.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 建站 > 正文

SSLH:让HTTPS和SSH共享同一个端口

发布时间:2019-08-20 21:37:58 所属栏目:建站 来源:Sk
导读:副标题#e# 一些 ISP 和公司可能已经阻止了大多数端口,并且只允许少数特定端口(如端口 80 和 443)访问来加强其安全性。在这种情况下,我们别无选择,但同一个端口可以用于多个程序,比如 HTTPS 端口 443,很少被阻止。通过 SSL/SSH 多路复用器 SSLH 的帮

检查 SSLH 守护程序是否正在监听 443。

  1. $ ps -ef | grep sslh
  2. sslh 2746 1 0 15:51 ? 00:00:00 /usr/sbin/sslh --foreground --user sslh --listen 0.0.0.0 443 --ssh 127.0.0.1 22 --ssl 127.0.0.1 443 --pidfile /var/run/sslh/sslh.pid
  3. sslh 2747 2746 0 15:51 ? 00:00:00 /usr/sbin/sslh --foreground --user sslh --listen 0.0.0.0 443 --ssh 127.0.0.1 22 --ssl 127.0.0.1 443 --pidfile /var/run/sslh/sslh.pid
  4. sk 2754 1432 0 15:51 pts/0 00:00:00 grep --color=auto sslh

现在,你可以使用端口 443 通过 SSH 访问远程服务器:

  1. $ ssh -p 443 [email protected]

示例输出:

  1. [email protected]'s password:
  2. Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-55-generic x86_64)
  3.  
  4. * Documentation: https://help.ubuntu.com
  5. * Management: https://landscape.canonical.com
  6. * Support: https://ubuntu.com/advantage
  7.  
  8. System information as of Wed Aug 14 13:11:04 IST 2019
  9.  
  10. System load: 0.23 Processes: 101
  11. Usage of /: 53.5% of 19.56GB Users logged in: 0
  12. Memory usage: 9% IP address for enp0s3: 192.168.225.50
  13. Swap usage: 0% IP address for enp0s8: 192.168.225.51
  14.  
  15. * Keen to learn Istio? It's included in the single-package MicroK8s.
  16.  
  17. https://snapcraft.io/microk8s
  18.  
  19. 61 packages can be updated.
  20. 22 updates are security updates.
  21.  
  22.  
  23. Last login: Wed Aug 14 13:10:33 2019 from 127.0.0.1

通过 SSH 使用 443 端口访问远程系统

通过 SSH 使用 443 端口访问远程系统

看见了吗?即使默认的 SSH 端口 22 被阻止,我现在也可以通过 SSH 访问远程服务器。正如你在上面的示例中所看到的,我使用 https 端口 443 进行 SSH 连接。

(编辑:西安站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读