解决公司运维网络限制的两种办法

解决公司运维网络限制的两种办法

在当今的企业环境中,出于安全和管理的考虑,很多公司的IT部门对内网进行了严格的限制。这些限制通常包括禁止直接从公司网络访问外部的SSH连接、封锁常用的远程桌面协议如RDP和VNC流量,以及禁用了如TeamViewer、AnyDesk、ToDesk等流行的远程控制软件。这种做法虽然能有效防止潜在的安全威胁,但同时也给需要远程访问工作资源的员工带来了不便。本文将介绍几种绕过这些限制的方法,以便在不影响公司网络安全的前提下,提高工作效率和灵活性。

方案一:使用Ocserv或AnyLink部署远程网关方案介绍Ocserv(OpenConnect Server)和AnyLink都是可以部署在服务器上的软件,它们能够创建一个VPN服务,让用户能够通过VPN安全地连接到公司的内网。这种方式需要为特定IP配置路由,以确保只有访问公司资源时才通过VPN,不影响正常的互联网访问。

官方地址:

Ocserv: https://ocserv.gitlab.io/www/

AnyLink: https://github.com/bjdgyc/anylink

部署文档地址

Ocserv部署文档: https://ocserv.gitlab.io/www/installation.html

AnyLink部署文档: https://github.com/bjdgyc/anylink/wiki

好处和缺点好处:

提供安全的远程访问内网资源的能力。

可以细粒度控制访问权限,增强安全性。

缺点:

配置和维护相对复杂,需要一定的网络知识。

可能与其他会修改路由的软件冲突,如公司内网会推送路由也可能会引起问题。

在macOS上,如果连接了Cisco AnyConnect,通过数据线连接的iPhone 15可能会断开连接,导致调试工作受阻。iPhone 13和iPhone X未发现此现象。

效果展示

方案二:使用Guacamole部署Web服务作为跳板机方案介绍Apache Guacamole是一个客户端无需安装任何插件或软件即可运行的远程桌面网关。用户通过Web浏览器就能访问远程的桌面环境,它支持标准的协议如VNC、RDP和SSH。

官方地址: https://guacamole.apache.org/

部署文档地址

Guacamole部署文档: https://guacamole.apache.org/doc/gug/

好处和缺点好处:

无需在客户端安装额外软件,通过浏览器即可访问远程桌面,方便快捷。

支持多种远程协议,灵活性高。

部署有OTP二次验证,增强安全性。

缺点:

需要额外的服务器资源来部署和运行Guacamole服务。

对于网络延迟较高的环境,用户体验可能受到影响。

推荐 docker 部署docker-compose.yml-> # cat /data/guacamole/docker-compose.yml

services:

guacamole:

image: jwetzell/guacamole:latest

container_name: guacamole

volumes:

- ./postgres:/config

environment:

- EXTENSIONS=auth-totp

ports:

- 8181:8080

volumes:

postgres:

driver: local

nginx 反向代理> # cat /etc/nginx/conf.d/guacamole.vanjay.cn.conf

server {

listen 127.0.0.2:80;

server_name guacamole.ddns.vanjay.cn;

return 301 https://$host$request_uri;

}

server {

listen 127.0.0.2:443 ssl;

server_name guacamole.ddns.vanjay.cn;

ssl_certificate /etc/nginx/ssl/guacamole.ddns.vanjay.cn_ecc/guacamole.ddns.vanjay.cn.cer;

ssl_certificate_key /etc/nginx/ssl/guacamole.ddns.vanjay.cn_ecc/guacamole.ddns.vanjay.cn.key;

include /etc/nginx/conf.d/common/ssl_common.conf;

include /etc/nginx/conf.d/common/add_header_fileserver.conf;

include /etc/nginx/conf.d/common/fileserver.conf;

location / {

# 不缓存,支持流式输出

proxy_cache off; # 关闭缓存

proxy_buffering off; # 关闭代理缓冲

chunked_transfer_encoding on; # 开启分块传输编码

tcp_nopush on; # 开启TCP NOPUSH选项,禁止Nagle算法

tcp_nodelay on; # 开启TCP NODELAY选项,禁止延迟ACK算法

keepalive_timeout 300; # 设定keep-alive超时时间为65秒

proxy_pass http://127.0.0.1:8181/;

include /etc/nginx/conf.d/common/proxy_http.conf;

}

}#

root@pve-ubuntu [04:43:08 PM] [~]

-> # cat /etc/nginx/conf.d/common/ssl_common.conf

ssl_protocols TLSv1.2 TLSv1.3;

ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384';

ssl_prefer_server_ciphers on;

ssl_session_cache shared:SSL:10m;

ssl_session_timeout 1d;

ssl_session_tickets off;

root@pve-ubuntu [04:43:50 PM] [~]

-> # cat /etc/nginx/conf.d/common/add_header_fileserver.conf

add_header Referrer-Policy "no-referrer" always;

add_header X-Content-Type-Options "nosniff" always;

add_header X-Download-Options "noopen" always;

add_header X-Frame-Options "SAMEORIGIN" always;

add_header X-Permitted-Cross-Domain-Policies "none" always;

add_header X-Robots-Tag "none" always;

add_header X-XSS-Protection "1; mode=block" always;

add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;

add_header Content-Security-Policy "frame-ancestors 'self' *.vanjay.cn";

charset utf-8;

root@pve-ubuntu [04:43:53 PM] [~]

-> # cat /etc/nginx/conf.d/common/fileserver.conf

include mime.types;

default_type application/octet-stream;

client_header_buffer_size 32k;

large_client_header_buffers 4 32k;

client_max_body_size 10240M;

client_body_timeout 3600s;

client_body_buffer_size 512k;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

fastcgi_send_timeout 3600;

fastcgi_read_timeout 3600;

fastcgi_buffer_size 64k;

fastcgi_buffers 4 64k;

fastcgi_busy_buffers_size 128k;

fastcgi_temp_file_write_size 256k;

fastcgi_intercept_errors on;

fastcgi_hide_header X-Powered-By;

gzip on;

gzip_vary on;

gzip_comp_level 4;

gzip_min_length 256;

gzip_types text/plain application/javascript application/x-javascript application/json application/ld+json application/manifest+json application/rss+xml text/javascript text/css application/xml;

gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;

gzip_disable "MSIE [1-6]\.";

server_tokens off;

root@pve-ubuntu [04:43:59 PM] [~]

-> # cat /etc/nginx/conf.d/common/proxy_http.conf

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

效果展示

以上是两种常见的绕过公司运维网络限制的方法。当然,选择哪种方案,需要根据具体的工作需求和网络环境来决定。重要的是,在不违反公司政策和法律法规的前提下,寻找最适合自己的工作方式。

相关推荐

試玩迷你 WinPhone!HTC HD mini 內外都出色
365平台被黑不给出款怎么办

試玩迷你 WinPhone!HTC HD mini 內外都出色

📅 07-03 👁️ 4108
硬盘为什么会有坏道?有坏道应该如何处理呢?
365bet大陆网站

硬盘为什么会有坏道?有坏道应该如何处理呢?

📅 07-04 👁️ 6362
热点连接为何频频掉线?五大原因及解决方案一网打尽
365平台被黑不给出款怎么办

热点连接为何频频掉线?五大原因及解决方案一网打尽

📅 06-30 👁️ 2829