bjdgyc / anylink

AnyLink是一个企业级远程办公 ssl vpn 软件,可以支持多人同时在线使用。基于 openconnect 协议开发,并且借鉴了 ocserv 的开发思路,可以完全兼容 AnyConnect 客户端。
GNU Affero General Public License v3.0
1.56k stars 375 forks source link

CentOS7 openconnect无法连接anylink #66

Closed TheresaQWQ closed 2 years ago

TheresaQWQ commented 2 years ago

anylink使用的是v0.6.2

openconnect版本

[root@ecs-zPBqW ~]# openconnect --version
OpenConnect 版本 v8.10
Using GnuTLS 3.3.29. Features present: TPM, PKCS#11, RSA software token, HOTP software token, TOTP software token, Yubikey OATH, DTLS, ESP
支持的协议: anyconnect(默认), nc, gp, pulse

openconnect日志

[root@ecs-zPBqW ~]# echo "password" | openconnect -u username --passwd-on-stdin xxxx.com
POST https://xxxx.com/
已连接到 xxx.xxx.xxx.xxx:xxxx

SSL 与 xxxx.com 协商
Connected to HTTPS on xxxx.com with ciphersuite (TLS1.2)-(ECDHE-RSA-SECP256R1)-(AES-128-GCM)
XML POST 已启用
请输入你的用户名和密码
GROUP: [xxxx]:xxxx
POST https://xxxx.com/
XML POST 已启用
请输入你的用户名和密码
POST https://xxxx.com/
得到了 CONNECT 响应:HTTP/1.1 200 OK
未接收到 MTU。正在中止
创建 SSL 连接失败
jiaxinonly commented 2 years ago

使用openconnect,我也遇见了同样的问题,使用anyconnect也不行,会报错: error: VPN establishment capability for a remote user is disabled. A VPN connection will not be established.

请问在centos7上该如何连接vpn呢?

itviewer commented 2 years ago

目前 profile.xml 是写死到代码里了,需要修改 https://github.com/bjdgyc/anylink/blob/4518959bf9ccef77552cf166fc73aebc857b13fd/server/handler/link_auth.go#L197

<WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment>

下面添加

<LinuxVPNEstablishment>AllowRemoteUsers</LinuxVPNEstablishment>

然后自己编译

附件是我自己编译好的,解压替换原来的可执行文件试试 anylink.zip

itviewer commented 2 years ago

使用以下命令编译的,或许可以避免 libc 依赖 go build -ldflags '-linkmode "external" -extldflags "-static"' anylink.zip

bjdgyc commented 2 years ago

已经修改profile文件

jiaxinonly commented 2 years ago

非常感谢各位,目前0.7.1版本,支持在centos7.5上,使用anyconnect和openconnect连接,0.5.1之前的版本,更改了数据库无法直接更换二进制文件,可以手动导出用户,并且保持用户名,pin码,OTP密钥一致即可