How to connect to an Openvpn Access Server in Linux

Posted on

Problem :

I’m working at a company that uses a lot of openvpn connections to different customers. Most of them are Openvpn Access Server.

100% of my coworkers use Mac or Windows but I would like to use Linux, but had the next problem. They use a vpn client called Viscosity That has an option to download aditional info from those openvpn servers. So they connect just using username and password.

But when I try to connect I’m forced to give a certificate + username and password.

I could ask for a .ovpn file, but is not the best solution because in this job the vpn changes everytime and I need to have the same functionality as they do.

Solution :

This was pretty easy to solve once i knew what to look.

What solved my problem was using the API of openvpn Access Server.
Using curl you can download the ovpn file with certs and everything.

curl -u vpnuser:vpnpassword https://<vpn-ip>:<vpn-port>/rest/GetUserlogin

If server has no valid ssl cert you can add the -k option (Not secure though)

I hope this answer helps anyone in a situation like mine a few month ago.

Leave a Reply

Your email address will not be published.