{"id":477,"date":"2013-03-14T14:21:31","date_gmt":"2013-03-14T13:21:31","guid":{"rendered":"https:\/\/hoover.gplrank.de\/?p=477"},"modified":"2013-05-01T12:59:33","modified_gmt":"2013-05-01T11:59:33","slug":"juniper-network-connect-on-ubuntu-linux-mint-64-bit-and-secure-id-token","status":"publish","type":"post","link":"https:\/\/hoover.gplrank.de\/?p=477","title":{"rendered":"Using Juniper Network Connect on Ubuntu \/ Linux Mint 64 bit with SecureID token authentication"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Why another step-by-step recipe? Well, none of the ones available worked for me on Linux Mint13 64bit, so here&#8217;s a quick rundown of what you need to do in order to connect to your juniper networks vpn gateway using Linux Mint \/ Ubuntu 64bit and your SecureID token (I cannot test any other methods).<\/p>\n<h2>Executive Summary \u00a0\/ Abstract<\/h2>\n<p>For the impatient, here&#8217;s a list of the required steps:<\/p>\n<ul>\n<li>Ensure your browser has a working java plugin (I used firefox)<\/li>\n<li><span style=\"line-height: 1.714285714; font-size: 1rem;\">download latest jnc software from your vpn gateway<\/span><\/li>\n<li><span style=\"line-height: 1.714285714; font-size: 1rem;\">download the vpn gateway certificate &amp; store it locally<\/span><\/li>\n<li><span style=\"line-height: 1.714285714; font-size: 1rem;\">ensure the first &#8220;java&#8221; found in your PATH is a <strong>32 bit version<\/strong> (installed from Oracle&#8217;s tar.gz-Archive, for instance)<\/span><\/li>\n<li><span style=\"line-height: 1.714285714; font-size: 1rem;\">ensure <strong>\/etc\/resolv.conf<\/strong> exists, otherwise nsvc will segfault after making a connection<\/span><\/li>\n<\/ul>\n<p>Need more info? Proceed at your own risk! \ud83d\ude09<\/p>\n<h2>Preparations<\/h2>\n<p>Remove \/ rename any previous installation from your home directory, changing to your home directory first:<\/p>\n<pre>cd\r\nmv .juniper_networks backup_juniper_networks<\/pre>\n<p>Make sure you are using Firefox for the next step with the java plugin enabled and &#8220;xterm&#8221; installed on your system (ia32-libs are required so that your system can run 32bit binaries):<\/p>\n<pre>sudo apt-get install xterm ia32-libs<\/pre>\n<h2>The Gritty Details<\/h2>\n<p>In firefox, type &#8220;about:plugins&#8221; in the browser bar and make sure the java plugin stuff comes up.<\/p>\n<p>Fire up your browser and go to your regular VPN login page to log in, using your secureid and token like you would on Windows.<\/p>\n<p>Download &amp; install the juniper networks software as usual, allow the java executable to run. (an xterm will come up asking you for your password). At least this much seemed to work out of the box for me.<\/p>\n<p>If everything goes well, you&#8217;ll find a new .juniper_networks directory in your home directory.<\/p>\n<p>Change into that directory and install a 32bit JDK from java.sun.com. I used this one:<\/p>\n<p>&nbsp;<\/p>\n<pre>cd .juniper_networks\r\n\r\nwget\u00a0<a title=\"jdk download\" href=\"http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/7u17-b02\/jdk-7u17-linux-i586.tar.gz\">http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/7u17-b02\/jdk-7u17-linux-i586.tar.gz<\/a><\/pre>\n<p>&nbsp;<\/p>\n<p>If wget doesn&#8217;t work, point your browser to java.sun.com and download the file manually, then move the tar archive to the .juniper_networks-Folder once the download is complete.<\/p>\n<p>Extract the tar.gz file in your .juniper_networks directory:<\/p>\n<pre>tar xvzf\u00a0<a title=\"jdk download\" href=\"http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/7u17-b02\/jdk-7u17-linux-i586.tar.gz\">jdk-7u17-linux-i586.tar.gz<\/a><\/pre>\n<p>Rename it to something like &#8220;java32&#8221; or thereabouts:<\/p>\n<pre>mv jdk-7u17-linux-i586 java32<\/pre>\n<p>Prepend the new jdk &#8220;bin&#8221; directory to your PATH:<\/p>\n<pre>export PATH=$HOME\/.juniper_networks\/java32\/bin:$PATH<\/pre>\n<p>Make sure you&#8217;re getting the right java:<\/p>\n<pre>which java \r\n$HOME\/.juniper_networks\/java32\/bin\/java<\/pre>\n<p>Now comes the really<strong> braindead<\/strong> part: Create a file \/etc\/resolv.conf, otherwise ncsvc will segfault after launch:<\/p>\n<pre>sudo emacs \/etc\/resolv.conf<\/pre>\n<p>Enter a std nameserver here, the important thing is that this file exists:<\/p>\n<pre>nameserver 8.8.8.8<\/pre>\n<p>Save the file. On you std. dhcp \/ network managed Ubuntu, this file won&#8217;t exist where jnc expects it, so you have to create it manually. Nice&#8230;<\/p>\n<p>Obtain your gateway&#8217;s SSL cert using the shell script provided in the &#8220;tmp&#8221; directory of your jnc installation:<\/p>\n<pre>cd ~\/.juniper_networks\/tmp\r\n\r\nchmod +x\u00a0.\/getx509certificate.sh\u00a0\r\n\r\n.\/getx509certificate.sh your.vpn.server.com ..\/network_connect\/vpn.crt<\/pre>\n<p>Change to your network_connect directory and run the &#8220;<strong>ncsvc&#8221;<\/strong> Command like so:<\/p>\n<pre>.\/ncsvc -h your.server.com -r \"Your Realm Name\" \u00a0-f vpn.crt -L 5 -u username -p xxxxYYYYYY<\/pre>\n<p>If you don&#8217;t know the realm, check the HTML source of your login page, it&#8217;s usually passed along to the cgi script using some form of &#8220;hidden&#8221; input tag. \u00a0&#8220;xxxx&#8221; is your SecureID pin, with &#8220;YYYYYY&#8221; indicates the current token.<\/p>\n<p>That&#8217;s it. Check the file ncsvc.log for any errors that might crop up. To track down the resolv.conf problem, I had to run &#8220;<strong>strace&#8221;<\/strong> on the command line above, dirty work but if it solves the problem&#8230;<\/p>\n<h2>Conclusion<\/h2>\n<p>All of this could be scripted up nicely (the PATH modification, the resolv.conf bits and so on), but wouldn&#8217;t it be easier if Juniper fixed their software? It&#8217;s quite hard to believe such a pile of crap should be let loose unto the world by such a renowned company, who knows what else lies waiting in this huge binary blob&#8230; sorry for the rant. \u00a0\ud83d\ude09<\/p>\n<h2>References<\/h2>\n<p><a href=\"http:\/\/www.joshhardman.net\/juniper-network-connect-vpn-linux-64-bit\/\">http:\/\/www.joshhardman.net\/juniper-network-connect-vpn-linux-64-bit\/<\/a><\/p>\n<p><a href=\"http:\/\/ubuntuforums.org\/showthread.php?t=232607&amp;page=45&amp;p=11189826#post11189826\">http:\/\/ubuntuforums.org\/showthread.php?t=232607&amp;page=45&amp;p=11189826#post11189826<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Hope this helps some of you, feel free to comment if you run into problems.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Why another step-by-step recipe? Well, none of the ones available worked for me on Linux Mint13 64bit, so here&#8217;s a quick rundown of what you need to do in order to connect to your juniper networks vpn gateway using Linux Mint \/ Ubuntu 64bit and your SecureID token (I cannot test any other methods). [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-477","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=477"}],"version-history":[{"count":16,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/477\/revisions"}],"predecessor-version":[{"id":496,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/477\/revisions\/496"}],"wp:attachment":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}