天依再吃俩包子(๑>⌔<๑)8

软件只适配到Ubuntu18.04,20.04需要弄一点东西

Ubuntu20.04如何使用EasyConnect进入校园网

现有docker容器docker-easyconnect

docker!yyds!一键部署

配合SwitchyOmega会有比较好的体验,不然一直切换有点麻烦 SwitchyOmega讲解

docker 启动

1
docker run --rm --device /dev/net/tun --cap-add NET_ADMIN -ti -p 127.0.0.1:1080:1080 -p 127.0.0.1:8888:8888 -e EC_VER=7.6.3 -e CLI_OPTS="-d vpnaddress -u username -p password" hagb/docker-easyconnect:cli

替换掉下面三个字段即可

vpnaddress:学校服务器地址,如https://vpn.nwpu.edu.cn

username:账号

password:密码

看的successful字段即为登录成功,按Ctrl c即可关闭docker,重新开始

持久化登录

1
2
3
touch $HOME/.easyconn

docker run --restart always --device /dev/net/tun --cap-add NET_ADMIN -ti -p 127.0.0.1:1080:1080 -p 127.0.0.1:8888:8888 -e EC_VER=7.6.3 -e CLI_OPTS="-d vpnaddress -u username -p password" -v $HOME/.easyconn:/root/.easyconn hagb/docker-easyconnect:cli

Ctrl c退出即可,容器不会关闭

配置SwitchyOmega,校园网的网站使用http 120.0.0.1 8888,其他的走clash代理http 127.0.0.1 7890或者直连

命令行使用 export https_proxy=http://127.0.0.1:8888可以让终端走代理

不过用ssh的git clone无法克隆下来仓库,不太懂

但如果使用proxychains填写http 127.0.0.1 8888则可克隆ssh的仓库 怪

1
2
3
4
5
6
7
8
9
10
11
$ proxychains4 git clone git@git.x.git
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.14
正克隆到 'x'...
[proxychains] DLL init: proxychains-ng 4.14
[proxychains] Dynamic chain ... 127.0.0.1:8888 ... git.x:22 ... OK
[proxychains] DLL init: proxychains-ng 4.14
remote: Enumerating objects: 1817, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (31/31), done.

直接使用软件(不推荐)

前言:首先下载一下软件,64位Ubuntu sudo dpkg -i EasyConnect_x64.deb 安装 其他版本

但软件本体只适配到Ubuntu18.04
吐槽一下:这官网上我是真没找到Linux版本,我们学校提供的网站的Linux下载又放了个空连接,麻
找了半天谷歌上搜到了天津大学的下载界面,但是最抽象的是,从主界面进去,根本找不到这个下载界面

安装后无法打开,原因是Harfbuzz版本太低

  • 单击打开easyconnect没有反应

    /usr/share/applications 中找到EasyConnect.desktop后发现它的命令行启动方式是/usr/share/sangfor/EasyConnect/EasyConnect

    执行后报错

    1
    2
    3
    4
    5
    $ /usr/share/sangfor/EasyConnect/EasyConnect

    (EasyConnect:64314): Pango-ERROR **: 15:45:06.256: Harfbuzz version too old (1.3.1)

    [1] 64314 trace trap (core dumped) /usr/share/sangfor/EasyConnect/EasyConnect

    提示Harfbuzz版本太低,论坛上有人提出这个问题,但目前也只适配ubuntu也至适配到18.04,原因可能是electron太老,最终提出的解决方案是把pango的版本降低,为了不对系统造成影响,因此只把低版本的pango给easyconnect用即可

  • 解决:降级pango

    先查看easyconnect目前使用的pango

    1
    2
    3
    4
    $ ldd /usr/share/sangfor/EasyConnect/EasyConnect | grep pango
    libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f9713518000)
    libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f971337e000)
    libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f97116d8000)

    下载适配ubuntu18.04的libpangocairolibpangolibpangoft2,解压deb,然后解压里面的data.tar.xz,找到上述所写三个文件移入/usr/share/sangfor/EasyConnect目录下即可

    为了方便,可以使用我已下载好的压缩包https://wwcm.lanzoub.com/ifd9c0kfvgmf 解压后放置在主目录下

    输入下面的指令把三个文件移入/usr/share/sangfor/EasyConnect

    1
    sudo cp ~/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 ~/usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 ~/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 /usr/share/sangfor/EasyConnect/

    再次查看即会发现发生变化

    1
    2
    3
    4
    $ ldd /usr/share/sangfor/EasyConnect/EasyConnect | grep pango
    libpangocairo-1.0.so.0 => /usr/share/sangfor/EasyConnect/libpangocairo-1.0.so.0 (0x00007f1538cd4000)
    libpango-1.0.so.0 => /usr/share/sangfor/EasyConnect/libpango-1.0.so.0 (0x00007f153893c000)
    libpangoft2-1.0.so.0 => /usr/share/sangfor/EasyConnect/libpangoft2-1.0.so.0 (0x00007f1536a95000)

    然后点击图标启动命令行启动/usr/share/sangfor/EasyConnect/EasyConnect都是可以的

参考链接:https://www.cnblogs.com/cocode/p/12890684.html

https://unix.stackexchange.com/questions/589993/pango-error-harfbuzz-version-too-old

https://www.cnblogs.com/panpanwelcome/p/12877902.html

https://packages.ubuntu.com/