{"id":414,"date":"2014-05-01T09:58:42","date_gmt":"2014-05-01T09:58:42","guid":{"rendered":"http:\/\/www.bartons.org.uk\/?page_id=414"},"modified":"2014-05-01T09:58:42","modified_gmt":"2014-05-01T09:58:42","slug":"openvpn","status":"publish","type":"page","link":"https:\/\/www.bartons.org.uk\/?page_id=414","title":{"rendered":"OpenVPN"},"content":{"rendered":"<p>If you are using OpenVPN Access Server you can disable the google auth on a per user basis by modifying the user database directly. There are a number of scripts located in \/usr\/local\/openvpn_as\/scripts (debian default), one of the commands that allows database modification\/viewing is &#8216;confdba&#8217;. This is how I disabled the auth temporarly on a user. You could also use the dba command tool to retrive the authenticator secret, due to it not being stored in encrypted fashion. While passwords are encrypted\/hashed in db, the google auth secret is not.<\/p>\n<p>Code:<br \/>\n# cd  \/usr\/local\/openvpn_as\/scripts<br \/>\n# .\/confdba -us -p &lt;username&gt; # Retrive current user properties<br \/>\n# .\/confdba -u -m -k pvt_google_auth_secret_locked -v false -p &lt;username&gt;  # Disable Google Auth for User<\/p>\n<p>\nAfter executing the above, the user should be able to login to the web connect to retrieve their google auth app, or rescan their qr code. BE VERY CAREFUL when modifying the database, you could seriously screw up your database if you don&#8217;t know what you&#8217;re doing, requiring a complete reinstall.<\/p>\n<p><strong>SSLCERTS From<\/strong>&#160;  <\/p>\n<p>http:\/\/docs.openvpn.net\/how-to-tutorialsguides\/administration\/cs-ca_bundle-cs-priv_key-cs-cert\/<\/p>\n<p>\nManaging SSL Web Certificates from the CLI<br \/>\nLast modified: 24 December 2011<\/p>\n<p>Managing SSL Web Certificates from the CLI<\/p>\n<p>Currently it is not possible to backup your SSL certificates over the Admin UI. That being said, it can be easily done via the CLI.<br \/>\nYou can also take advantage of the CLI to also transfer SSL certificates across different Access Server instances, or to install new ones you&#8217;ve purchased from a SSL certificates vendor or self-signed with OpenSSL.<br \/>\nPlease note the following instructions will ONLY work when you have an actual certificate (not the built-in self-signed one) installed on your server!<br \/>\nIn addition, NO ERROR CHECKING will be performed on the certificates if they are installed this way. You could render your server UNUSABLE if the correct certificates are not installed.<\/p>\n<p>In order to do so, you will need SSH access to your Access Server.<br \/>\nTo begin, you will need to launch a SSH client such as PuTTY to connect to your server using SSH:<\/p>\n<p>Start PuTTY and connect to the IP address of your server on port 22, SSH, and click &#8216;Open&#8217;.<\/p>\n<p>Enter the server&#8217;s username and password. It must have root access. This is not the VPN client username!<\/p>\n<p>Execute command: cd \/usr\/local\/openvpn_as\/scripts\/<\/p>\n<p>To backup the existing CA bundle, private key, and server certificate:<\/p>\n<p>CA Bundle:<\/p>\n<p>Execute command: .\/confdba -gk cs.ca_bundle<\/p>\n<p>Scroll up (if necessary), and start selecting from &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;, stop the selection when you hit the last &#8212;&#8211;END CERTIFICATE&#8212;&#8211;.<\/p>\n<p>The CA bundle is now copied to the clipboard. Open up a text editor, paste the contents into the editor, and then save the file as ca.crt.<\/p>\n<p>Private Key:<\/p>\n<p>Execute command: .\/confdba -gk cs.priv_key<\/p>\n<p>Scroll up (if necessary), and start selecting from &#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211;, stop the selection when you hit &#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211;.<\/p>\n<p>The Private Key is now copied to the clipboard. Open up a text editor, paste the contents into the editor, and then save the file as server.key.<\/p>\n<p>Server Certificate:<\/p>\n<p>Execute command: .\/confdba -gk cs.cert<\/p>\n<p>Scroll up (if necessary), and start selecting from &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;, stop the selection when you hit &#8212;&#8211;END CERTIFICATE&#8212;&#8211;.<\/p>\n<p>The Server Certificate is now copied to the clipboard. Open up a text editor, paste the contents into the editor, and then save the file as server.crt.<\/p>\n<p>To install the CA bundle, private key, and server certificate from a backup:<\/p>\n<p>CA Bundle (if you self-signed your server certificate without a CA, please use your server certificate as a CA bundle):<br \/>\nOpen up the CA Bundle file in a text editor, then copy all the contents of that file to the clipboard.<\/p>\n<p>Type the follow command (but do not press Enter yet, notice the single quote at the end of the line): .\/confdba -mk cs.ca_bundle -v &#8216;<\/p>\n<p>If using PuTTY, right click the terminal to paste the contents of the CA Bundle onto the terminal window.<\/p>\n<p>After the contents of the CA Bundle is pasted into the terminal window, enter another single quote, followed by the Enter key.<\/p>\n<p>The CA Bundle is now restored.<\/p>\n<p>Private Key:<br \/>\nOpen up the Private Key file in a text editor, then copy all the contents of that file to the clipboard.<\/p>\n<p>Type the follow command (but do not press Enter yet, notice the single quote at the end of the line): .\/confdba -mk cs.priv_key -v &#8216;<\/p>\n<p>If using PuTTY, right click the terminal to paste the contents of the Private Key onto the terminal window.<\/p>\n<p>After the contents of the Private Key is pasted into the terminal window, enter another single quote, followed by the Enter key.<\/p>\n<p>The Private Key is now restored.<\/p>\n<p>Server Certificate:<br \/>\nOpen up the Server Certificate file in a text editor, then copy all the contents of that file to the clipboard.<\/p>\n<p>Type the follow command (but do not press Enter yet, notice the single quote at the end of the line): .\/confdba -mk cs.cert -v &#8216;<\/p>\n<p>If using PuTTY, right click the terminal to paste the contents of the Server Certificate onto the terminal window.<\/p>\n<p>After the contents of the Server Certificate is pasted into the terminal window, enter another single quote, followed by the Enter key.<\/p>\n<p>The Server Certificate is now restored.<\/p>\n<p>Restart the Access Server completely by invoking the following command: \/etc\/init.d\/openvpnas restart<\/p>\n<p>If the certificates were installed correctly, the server should start without a problem. On the other hand, invalid certificates installed on the server will block the server from starting.<br \/>\nIf you would like to revert back to the original built-in self-signed certificate after an installation of custom SSL certificates have failed, execute the following commands:<br \/>\n.\/confdba -mk cs.ca_bundle<br \/>\n.\/confdba -mk cs.priv_key<br \/>\n.\/confdba -mk cs.cert<br \/>\n\/etc\/init.d\/openvpnas restart<\/p>\n<p>To validate that the certificate is properly installed, visit the Web Server section in the Admin UI<\/p>\n<p><strong>Disabling the Lock Out aka (bootstrap) account (optional)<\/strong><br \/>\nIn the setup wizard, you were prompted to create an initial username and password that allowed you to login to the Admin Web UI. This username and password combination will always be active disregarding its status in the &#8220;User Permissions&#8221;area. This might be undesirable if your server is facing the Internet since anyone who has this username and password combination will have full administrator rights to change any setting on your Access Server Admin Web UI. After you have created a secondary administrator account in the Admin Web UI, you may disable this lock out account by following the steps below:<\/p>\n<p>Enter the command: nano \/usr\/local\/openvpn_as\/etc\/as.conf<br \/>\nPress the Page Down key on your keyboard and scroll down with your Down arrow key until you see entries starting with boot_pam_users.<br \/>\nPut a # sign before the entry correlating to the bootstrap username you have created previously. Usually this is the boot_pam_users.0= entry. DO NOT put a # sign before the boot_pam_service entry. Doing so will cause unexpected behaviors in your VPN server.<br \/>\nPress CTRL+O, and then press Enter. Then press CTRL+X to exit the editor.<br \/>\nRestart the VPN server by entering the following command: \/etc\/init.d\/openvpnas restart<\/p>\n<p>You may choose to reenable this feature at any time by removing the #sign from the aformentioned file and restarting Access Server.<br \/>\nUpdating Operating System Software (recommended)<br \/>\nFrom the time we have generated the appliance and the time you have downloaded and are using the appliance, many operating system updates might have became available. To make sure your appliance operating system is up to date, execute the following command: apt-get update &amp;&amp; apt-get upgrade<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are using OpenVPN Access Server you can disable the google auth on a per user basis by modifying the user database directly. There are a number of scripts located in \/usr\/local\/openvpn_as\/scripts (debian default), one of the commands that allows database modification\/viewing is &#8216;confdba&#8217;. This is how I disabled the auth temporarly on a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":70,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-414","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=414"}],"version-history":[{"count":0,"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/414\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=\/wp\/v2\/pages\/70"}],"wp:attachment":[{"href":"https:\/\/www.bartons.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}