Date Published: October 24, 2016

Junos Pulse VPN client on Linux. Two phase auth. 64bit. How to make it all work.

There are several problem common problems with Juniper SSL VPN on support of Linux clients:

1.Most 64-bit platforms are not supported.
2.Junos Pulse SSL VPN does not support Linux at all.

Best way to cover problem “1” is:
There is also well known mad-scientist way but its more complex.

Problem “2” is a bit more involved.

In my case when I login to Juniper SSL web interface it run host-checker and as Linux is not supported the web form does not have way to launch Junos Pulse SSL VPN client. In fact that client does not exists for Linux.
Good news are: old Juniper “Network Connect” client is compatible with Junos Pulse and can be used on Linux client.

So you can still launch “Network Connect” client, separately from your web session.
If on login you only asked user name and password (either AD password or SecurID), you lucky and you can easy launch “Network Connect” as described in several sources, for example:

But if your VPN server use two phase auth scheme (SecurID + AD password), it can get more involved. Scott has GREAT blog on how to make it work:
Only thing – you have to copy DSID cookie manually and paste it as argument in ncui call. There are several projects to automate that, for example: or

Both are py scripts to simulate browser behavior. Great stuff, But it did not work for me. I believe its because before I can get to login page I have one more “Legal” page where “Agree” has to be clicked. So I decided to actually use browser for login, and just have an automated way to pass DSID cookie to the script to launch ncui. Below are steps for that. –

Get network connect client + ncui executable (mostly from Scott’s blog):

  • Login to your VPN
  • Get Network Connect client at:
  • Install Network Connect client, gcc ncui executable, and get cert file:
    sudo apt-get install gcc-multilib mkdir ~/.juniper_networks/network_connect cd ~/.juniper_networks/network_connect mv ~/Downloads/ncLinuxApp.jar . jar -xf ncLinuxApp.jar sudo gcc -m32 -Wl,-rpath,`pwd` -o ncui sudo chown root:root ncui sudo chmod 4755 ncui echo | openssl s_client -connect 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -outform der > ssl.crt

Problem with DSID cookie – its Session Level, so it does not persist on disk, where you can grep it from. So had to use Greasemonkey plugin for firefox to capture DSID and save to HTML5 storage.
Install Greasemonkey plugin and make sure its enabled.

  • Create Greasemonkey js script (replace to dump DSID to webappsstore.sqlite file:
    mkdir ~/Greasemonkey/ cat >> ~/Greasemonkey/jsessionid.user.js <<EOF // ==UserScript== // @name DSID to localStorage // @namespace // @description Saves the DSID cookie in localStorage // @include* // ==/UserScript== (function() { var sessid = document.cookie.match(/DSID=([^;]+)/); if (sessid) { var oldSID = localStorage.DSID; if (sessid != oldSID) localStorage.DSID = sessid[1]; } })(); EOF
  • In Firefox: Menu -> File -> Open File -> Choose “jsessionid.user.js”, and enable the script in the pop up window
  • Install sqlite:
    mkdir ~/bin/ cd ~/bin/ wget unzip sqlite-shell-linux-x86-*.zip
  • Create script to get DCID value from webappsstore.sqlite and launch ncui (replace
    cat > ~/bin/ <<"EOF1" sudo touch /etc/jnpr-nc-resolv.conf sudo touch /etc/jnpr-nc-hosts.bak dsid1=`~/bin/sqlite3 ~/.mozilla/firefox/*.default/webappsstore.sqlite <<EOF | grep "https:443|DSID" | awk -F"|" '{print $3}' select * from webappsstore2; EOF` echo dsid1=$dsid1 cd ~/.juniper_networks/network_connect/ ./ncui -h -c DSID=$dsid1 -f ssl.crt EOF1 chmod 700 ~/bin/
  • Run the script, it will prompt for the AD password. (Ctrl+C to end vpn connection)
  • In another window check if VPN interface is active:
    ifconfig | grep tun

And if so – You are on VPN!.. Time to get to real work J
p.s. And use sun java.- Open jdk has old known problems with juniper VPN.


Write a Reply or Comment

Your email address will not be published. Required fields are marked *