解決在ubuntu 上安裝 the Cisco AnyConnect client(vpn外掛)的問題

小魚兒的部落格發表於2018-04-19

Installing the Cisco AnyConnect client

  1. First, make sure you have the necessary Debian/Ubuntu support packages installed:
    $ sudo apt-get update
    $ sudo apt-get install lib32z1 lib32ncurses5
  2. 下載安裝包 開啟連結 https://uci.service-now.com/kb_view.do?sysparm_article=KB0010201
  3. 下載32 or 64 bit client as a .gz file.
  • 如果你不知道這個那個版本,你可以這樣:
    $ uname -a
    Linux sporkula 3.19.0-31-lowlatency #36-Ubuntu SMP PREEMPT Wed Oct 7 15:44:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    $_
將tar包下載到Downloads資料夾並解壓
~$ cd ~/Downloads
~/Downloads]$ tar -xzvf anyconnect-predeploy-linux-64-4.3.05017-k9.tar\ 6.59.23\ AM.gz
anyconnect-4.3.05017/
anyconnect-4.3.05017/vpn/
anyconnect-4.3.05017/vpn/vpn_install.sh
anyconnect-4.3.05017/vpn/vpnagentd
anyconnect-4.3.05017/vpn/vpnagentd_init
anyconnect-4.3.05017/vpn/vpn_uninstall.sh
anyconnect-4.3.05017/vpn/anyconnect_uninstall.sh
anyconnect-4.3.05017/vpn/libacciscossl.so
anyconnect-4.3.05017/vpn/libacciscocrypto.so
anyconnect-4.3.05017/vpn/libaccurl.so.4.3.0
anyconnect-4.3.05017/vpn/vpnui
anyconnect-4.3.05017/vpn/cisco-anyconnect.desktop
anyconnect-4.3.05017/vpn/cisco-anyconnect.menu
anyconnect-4.3.05017/vpn/cisco-anyconnect.directory
anyconnect-4.3.05017/vpn/libvpnagentutilities.so
anyconnect-4.3.05017/vpn/libvpncommon.so
anyconnect-4.3.05017/vpn/libvpncommoncrypt.so
anyconnect-4.3.05017/vpn/libvpnapi.so
anyconnect-4.3.05017/vpn/libvpnipsec.so
anyconnect-4.3.05017/vpn/vpn
anyconnect-4.3.05017/vpn/acinstallhelper
anyconnect-4.3.05017/vpn/pixmaps/
anyconnect-4.3.05017/vpn/pixmaps/company-logo.png
anyconnect-4.3.05017/vpn/pixmaps/cvc-about.png
anyconnect-4.3.05017/vpn/pixmaps/cvc-configure.png
anyconnect-4.3.05017/vpn/pixmaps/cvc-connect.png
anyconnect-4.3.05017/vpn/pixmaps/cvc-disconnect.png
anyconnect-4.3.05017/vpn/pixmaps/cvc-info.png
anyconnect-4.3.05017/vpn/pixmaps/systray_connected.png
anyconnect-4.3.05017/vpn/pixmaps/systray_disconnecting.png
anyconnect-4.3.05017/vpn/pixmaps/systray_notconnected.png
anyconnect-4.3.05017/vpn/pixmaps/systray_quarantined.png
anyconnect-4.3.05017/vpn/pixmaps/systray_reconnecting.png
anyconnect-4.3.05017/vpn/pixmaps/vpnui48.png
anyconnect-4.3.05017/vpn/pixmaps/downloader-arrow.png
anyconnect-4.3.05017/vpn/manifesttool
anyconnect-4.3.05017/vpn/ACManifestVPN.xml
anyconnect-4.3.05017/vpn/vpndownloader
anyconnect-4.3.05017/vpn/vpndownloader-cli
anyconnect-4.3.05017/vpn/update.txt
anyconnect-4.3.05017/vpn/OpenSource.html
anyconnect-4.3.05017/vpn/AnyConnectProfile.xsd
anyconnect-4.3.05017/vpn/AnyConnectLocalPolicy.xsd
anyconnect-4.3.05017/vpn/libacfeedback.so
anyconnect-4.3.05017/vpn/license.txt
anyconnect-4.3.05017/vpn/VeriSignClass3PublicPrimaryCertificationAuthority-G5.pem
anyconnect-4.3.05017/dart/
anyconnect-4.3.05017/dart/dart_install.sh
anyconnect-4.3.05017/dart/AMPEnabler.xml
anyconnect-4.3.05017/dart/AnyConnectConfig.xml
anyconnect-4.3.05017/dart/BaseConfig.xml
anyconnect-4.3.05017/dart/ConfigXMLSchema.xsd
anyconnect-4.3.05017/dart/DARTGUI.glade
anyconnect-4.3.05017/dart/ISEPosture.xml
anyconnect-4.3.05017/dart/NetworkVisibility.xml
anyconnect-4.3.05017/dart/Posture.xml
anyconnect-4.3.05017/dart/RequestXMLSchema.xsd
anyconnect-4.3.05017/dart/Umbrella.xml
anyconnect-4.3.05017/dart/cisco-anyconnect-dart.desktop
anyconnect-4.3.05017/dart/cisco-anyconnect-dart.directory
anyconnect-4.3.05017/dart/cisco-anyconnect-dart.menu
anyconnect-4.3.05017/dart/ciscoLogo.png
anyconnect-4.3.05017/dart/dartCustom.png
anyconnect-4.3.05017/dart/dartTypical.png
anyconnect-4.3.05017/dart/dart_uninstall.sh
anyconnect-4.3.05017/dart/dartcli
anyconnect-4.3.05017/dart/dartcli.symbols
anyconnect-4.3.05017/dart/dartui
anyconnect-4.3.05017/dart/dartui.symbols
anyconnect-4.3.05017/dart/license.txt
anyconnect-4.3.05017/dart/manifesttool
anyconnect-4.3.05017/dart/ACManifestDART.xml
anyconnect-4.3.05017/posture/
anyconnect-4.3.05017/posture/ciscod
anyconnect-4.3.05017/posture/cscan
anyconnect-4.3.05017/posture/ciscod_init
anyconnect-4.3.05017/posture/cstub
anyconnect-4.3.05017/posture/posture_install.sh
anyconnect-4.3.05017/posture/posture_uninstall.sh
anyconnect-4.3.05017/posture/libcsd.so
anyconnect-4.3.05017/posture/libhostscan.so
anyconnect-4.3.05017/posture/libinspector.so
anyconnect-4.3.05017/posture/license.txt
anyconnect-4.3.05017/posture/tables.dat
anyconnect-4.3.05017/posture/ACManifestPOS.xml
anyconnect-4.3.05017/posture/libaccurl.so.4.3.0
anyconnect-4.3.05017/posture/libacciscocrypto.so
anyconnect-4.3.05017/posture/libacciscossl.so
~/Downloads]$ cd anyconnect-4.3.05017
~/Downloads/anyconnect-4.3.05017]$ cd vpn
~/Downloads/anyconnect-4.3.05017/vpn]$ ls -lh
$ total 12M
-rwxr-xr-x 1 jas jas  14K Dec  9  2016 acinstallhelper
-rw-r--r-- 1 jas jas  262 Dec  9  2016 ACManifestVPN.xml
-rw-r--r-- 1 jas jas 6.6K Dec  9  2016 AnyConnectLocalPolicy.xsd
-rw-r--r-- 1 jas jas  83K Dec  9  2016 AnyConnectProfile.xsd
-rwxr-xr-x 1 jas jas  502 Dec  9  2016 anyconnect_uninstall.sh
-rw-r--r-- 1 jas jas  279 Dec  9  2016 cisco-anyconnect.desktop
-rw-r--r-- 1 jas jas  164 Dec  9  2016 cisco-anyconnect.directory
-rw-r--r-- 1 jas jas  603 Dec  9  2016 cisco-anyconnect.menu
-rwxr-xr-x 1 jas jas 2.6M Dec  9  2016 libacciscocrypto.so
-rwxr-xr-x 1 jas jas 436K Dec  9  2016 libacciscossl.so
-rwxr-xr-x 1 jas jas 232K Dec  9  2016 libaccurl.so.4.3.0
-rwxr-xr-x 1 jas jas 168K Dec  9  2016 libacfeedback.so
-rwxr-xr-x 1 jas jas 888K Dec  9  2016 libvpnagentutilities.so
-rwxr-xr-x 1 jas jas 1.6M Dec  9  2016 libvpnapi.so
-rwxr-xr-x 1 jas jas 530K Dec  9  2016 libvpncommoncrypt.so
-rwxr-xr-x 1 jas jas 1.7M Dec  9  2016 libvpncommon.so
-rwxr-xr-x 1 jas jas 1.1M Dec  9  2016 libvpnipsec.so
-rw-r--r-- 1 jas jas  13K Dec  9  2016 license.txt
-rwxr-xr-x 1 jas jas 480K Dec  9  2016 manifesttool
-rw-r--r-- 1 jas jas  68K Dec  9  2016 OpenSource.html
drwxr-sr-x 2 jas jas 4.0K Dec  9  2016 pixmaps
-rw-r--r-- 1 jas jas   10 Dec  9  2016 update.txt
-rw-r--r-- 1 jas jas 1.8K Dec  9  2016 VeriSignClass3PublicPrimaryCertificationAuthority-G5.pem
-rwxr-xr-x 1 jas jas  65K Dec  9  2016 vpn
-rwxr-xr-x 1 jas jas 724K Dec  9  2016 vpnagentd
-rw-r--r-- 1 jas jas 2.1K Dec  9  2016 vpnagentd_init
-rwxr-xr-x 1 jas jas 424K Dec  9  2016 vpndownloader
-rwxr-xr-x 1 jas jas 396K Dec  9  2016 vpndownloader-cli
-rwxr-xr-x 1 jas jas  24K Dec  9  2016 vpn_install.sh
-rwxr-xr-x 1 jas jas 176K Dec  9  2016 vpnui
-rwxr-xr-x 1 jas jas 8.4K Dec  9  2016 vpn_uninstall.sh
~/Downloads/anyconnect-4.3.05017/vpn]$ ./vpn_install.sh
Installing Cisco AnyConnect Secure Mobility Client...
Sorry, you need super user privileges to run this script.
~/Downloads/anyconnect-4.3.05017/vpn]$ sudo ./vpn_install.sh
...
Do you accept the terms in the license agreement? [y/n] y
You have accepted the license agreement.
Please wait while Cisco AnyConnect Secure Mobility Client is being installed...
Starting Cisco AnyConnect Secure Mobility Client Agent...
Done!
~/Downloads/anyconnect-4.3.05017/vpn]$ _
		
如果安裝過程中出現如下錯誤:可能是沒有安裝一些依賴包
Failed to start vpnagentd.service: Unit vpnagentd.service failed to load: No such file or directory:
$ sudo apt-get install network-manager-openconnect
重新開啟程式:
$ sudo systemctl daemon-reload
檢視程式是否開啟:
$ ps auxw | grep vpnagentd | grep -v grep
   root      3049  0.0  0.2 165960  8356 ?        Sl   09:07   0:04 /opt/cisco/anyconnect/bin/vpnagentd
查詢vpnagent所在資料夾位置
$ find /etc/rc?.d -type l -name "*vpnagentd*"
   /etc/rc2.d/K25vpnagentd
   /etc/rc2.d/S85vpnagentd
   /etc/rc3.d/K25vpnagentd
   /etc/rc3.d/S85vpnagentd
   /etc/rc4.d/K25vpnagentd
   /etc/rc4.d/S85vpnagentd
   /etc/rc5.d/K25vpnagentd
   /etc/rc5.d/S85vpnagentd
或者使用命令
$ ls -l /etc/rc?.d/*vpn*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc2.d/K25vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc2.d/S85vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc3.d/K25vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc3.d/S85vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc4.d/K25vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc4.d/S85vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc5.d/K25vpnagentd -> /etc/init.d/vpnagentd*
   lrwxrwxrwx 1 root root 21 Jun  5 09:07 /etc/rc5.d/S85vpnagentd -> /etc/init.d/vpnagentd*
使命令別名指向vpn和vpnui命令:
$ alias vpn='/opt/cisco/anyconnect/bin/vpn'
$ alias vpnui='/opt/cisco/anyconnect/bin/vpnui'
編輯~/.bashrc or ~/.bash_aliases 資料夾:
$ cat >> ~/.bash_aliases
alias vpn='/opt/cisco/anyconnect/bin/vpn'
alias vpnui='/opt/cisco/anyconnect/bin/vpnui'
^D
$ _


執行
$ vpnui


ok,現在可以使用vpn連結了

相關文章