openconnect 是兼容cisco anyconnect
bashyum update -y yum install -y openconnect
bashcat /etc/systemd/system/openconnect.service
[Unit]
Description=OpenConnect VPN Client
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/bin/bash -c '/bin/echo -n your_pasw | /usr/sbin/openconnect your_server -u your_username --passwd-on-stdin'
ExecStop=/usr/bin/pkill openconnect
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
#重载配置
systemctl daemon-reload
#设置开机启动
systemctl enable openconnect.service
#启动测试
systemctl start openconnect.service
systemctl status openconnect.service
注意:关闭服务可能会导致本机网络有问题,需要重启本机网络。
bashsystemctl restart network
本文作者:mykernel
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!