easyconnect for docker
·
背景
easyconnect会和电脑的硬件绑定,换个电脑可能就没法用了,如何在任意一台ubuntu系统中easyconnect连接内网呢?这时可以考虑github上的easyconnect for docker项目。
docker easyconnect安装
安装上docker后,运行下列命令就行
pnadd=https://abc.com.cn:8987 # 网址
mac= # 授权了的电脑的mac地址
username= #你的账户名
psw= #你的密码
img=hagb/docker-easyconnect:7.6.7
sudo rm -rf /tmp/.X11-unix/X1
sudo docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti \
-p 0.0.0.0:1080:1080 -p 127.0.0.1:8888:8888 \
-p 0.0.0.0:5901:5901 \
-p 0.0.0.0:3389:3389 \
--mac-address $mac \
-e EC_ADDRESS=$vpnadd \
-e EC_USERNAME=$username \
-e EC_PASSWORD=$psw \
-v $PWD/.Xauthority:/root/.Xauthority \
-v /tmp:/tmp \
--name myeasyconnect \
$img
运行后,会在1080端口开socks5代理,8888端口开http代理。
网页设置
通过插件设置127.0.0.1:8888代理即可,可以用过网页访问内网网址
远程桌面设置,有些公司使用xrdp,有些用exceed turbox, 这里分别列下设置项。
remmina设置代理
参考链接.
- 先用remmina创建一个某个ip的连接,这时当然登录不上。这个连接有个配置文件位于一个类似下面路径的地方/home/user/snap/remmina/5237/.local/share/remmina
- 添加代理配置
proxy_hostname=localhost
proxy_type=socks5
proxy_port=1080
然后重新连接就行 。
Exceed turbox使用easyconnect 的代理
- 首先知道etxlauncher的安装目录,这里是~/app/etxlauncher_12/.
- 将原始etxlauncher改名,并创建一个同名的bash,让网页直接调这个bash
mv etxlauncher etxlauncher.real
touch etxlauncher
chmod +x etxlauncher
sudo apt install proxychains-ng -y
- 使用proxychain设置代理。
sudo tee /etc/proxychains-etx.conf << 'EOF'
strict_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
# 优先 socks5,更快更稳
socks5 127.0.0.1 1080
# 备选 http
http 127.0.0.1 8888
EOF
sudo tee ~/app/etxlauncher_12/bin/etxlauncher << 'EOF'
#!/bin/bash
exec proxychains4 -f /etc/proxychains-etx.conf /home/lyy/app/etxlauncher_12/bin/etxlauncher.real "$@"
EOF
sudo chmod +x ~/app/etxlauncher_12/bin/etxlauncher
重新刷新网页即可。
更多推荐




所有评论(0)