kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.7k stars 2.38k forks source link

otp with google authenticator kinda works except for the issuer #571

Open PPillau opened 4 years ago

PPillau commented 4 years ago

So I've been following the setup in the docs for 2fa/otp and got confused at this step:

docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_otp_user <user>

This command prints the link to the QR code that, once scanned, actually produces the right code in google auth to log into the vpn. (Note that it still gives me an error because it cannot print the QR code in the terminal because it "failed to use libqrencode". Maybe somebody got a fix for that as well...)

On the other hand running the google authenticator command myself (3rd step in otp doc):

google-authenticator --time-based --disallow-reuse --force --rate-limit=3 --rate-time=30 --window-size=3 \ -l "${1}@${OVPN_CN}" -s /etc/openvpn/otp/${1}.google_authenticator

does not print a link to a google auth instance that produces a right code for login. Which kinda confuses me because as I understand the first command basically does exactly the same. This wouldn't bother me any further because I could just only use the first command, but for the fact that the first command (which produces the working google auth link) has a gibberish string as the issuer, while the second one (running google_authenticator myself) does not, which looks way cleaner in google auth, so I want to make the second command work for me...

Does anybody have an idea whats going on here? Sorry if I expressed myself unclearly, just ask if you didn't understand my problem maybe I can explain further...

johnjtran commented 3 years ago

@PPillau you've explained yourself pretty well. The problem is that the Dockerfile is missing apk add libqrencode which is a simple fix. Maybe I'll do a pull request, but for now, I baked my own Dockerfile:

FROM kylemanna/openvpn
RUN apk add libqrencode