{"id":461,"date":"2019-08-17T13:41:20","date_gmt":"2019-08-17T13:41:20","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=461"},"modified":"2019-08-17T13:41:20","modified_gmt":"2019-08-17T13:41:20","slug":"how-to-save-openvpn-username-password","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-save-openvpn-username-password.html","title":{"rendered":"How to Save OpenVPN Username &#038; Password"},"content":{"rendered":"\n<p>If you are using OpenVPN in a Linux platform through command line, it is always handy to be able to save the authentication information in a file and let openvpn use them. There are two ways you can do it.<\/p>\n\n\n\n<p><strong>First Method<\/strong><\/p>\n\n\n\n<p>First save the password in a file e.g auth.txt with two lines:<\/p>\n\n\n\n<p><code>username<br>password<\/code><\/p>\n\n\n\n<p>First line is for username and the second line is for password.<\/p>\n\n\n\n<p>If you are using .ovpn files for configuration, open the .ovpn file and simply add the following:<\/p>\n\n\n\n<p><code>auth-user-pass auth.txt<\/code><\/p>\n\n\n\n<p>Now, your authentication would use the authentication given in that file<\/p>\n\n\n\n<p><strong>Second Method<\/strong><\/p>\n\n\n\n<p>You may add the <code>auth-user-pass<\/code> in the openvpn command line argument, but you have to make sure, this is passed after the <code>--config<\/code>. Here is an example<\/p>\n\n\n\n<p><code>openvpn --config \"your_file.ovpn\" --auth-user-pass \"auth.txt\"<\/code><\/p>\n\n\n\n<p>That should be enough.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are using OpenVPN in a Linux platform through command line, it is always handy to be able to save the authentication information in a file and let openvpn use them. There are two ways you can do it. First Method First save the password in a file e.g auth.txt with two lines: usernamepassword &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-save-openvpn-username-password.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Save OpenVPN Username &#038; Password&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[144,12,237,294],"tags":[],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/461"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":462,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions\/462"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}