Log in to NordVPN in the terminal

Hey there, I recently set up an Ubuntu server (running Ubuntu 20.04.3 LTS) and I was trying to log in to my NordVPN account on the server.
The issue is when I try to log in it asks me to proceed to a browser, as can be seen here. Even though I can ssh into the server (which is what I’m doing), copy-paste that link in a browser, and log in, I am not logged in as the client still needs an auth token or something similar to be able to log in, which is not asked for.
I remember previously being able to log in by actually typing your credentials in the terminal like this. Is this not possible anymore? If not, how can I log in?
Thanks in advance!

I struggled with this just yesterday and find out that in the man nordvpn you can find the proper instruction on how to proceed with login with nordaccount (default from version 3.12 I guess):

  • type nordvpn login into the cli
  • proceed through the browser
  • once you’ve logged in copy the link where it says “return to the app” (it should be something like nordvpn://login etc)
  • go back to cli and type nordvpn login --callback "pasted-url-from-before" (pay attention to quote the url!)
  • now you’re logged in

I know this is marked as solved, but I’m leaving this here for other ppl that may encounter the same issue.

https://support.nordvpn.com/Connectivity/Linux/1047409422/How-can-I-connect-to-NordVPN-using-Linux-Terminal.htm

Basically you install openvpn and download their ovpn profiles. It will ask for username and password to sign in, no browser.

For anyone experiencing this issue right now with Ubuntu 22.04, the following line resolved the issue for me:

sudo ln -s /usr/bin/resolvectl /usr/bin/systemd-resolve

That was from their support btw ^^^

There’s a better way and it supports MFA, which you should have anyway.

After you do the normal login on the browser after following the link on the CLI after doing nordvpn login, cancel out of the “Open with” popup, and copy the link that is assigned to the “Continue” link, under the message saying “You’ve successfully logged in” (should be a nordvpn:// link).

Then do nordvpn login --callback "nordvpn://link" and it should log you in.

NordVPN should document this on the callback page, place the callback URL in visible text, with a copy button, etc… like most other OAuth workflows.

Absolute legend mate, was tearing my hair out thinking how stupid it was that I couldn’t login! Thank you so much!

working! saved my day!

nordvpn login --legacy

Thank you so much! The first solution did it for me (didn’t test the second one but I’m pretty positive it works as well)!

After 5 months later, I can confirm that the nordvpn login --callback method works perfectly. It is not necessary the legacy method.

Thank you very much, didn’t know about the --legacy flag.

nordvpn login --username username --password password

worked, thanks :slight_smile:

very neat. If they ever remove the login --legacy option then this will be the go-to method.

great stuff! thank you very much

Thank you! That is exactly what I was looking for.

Thanks man, I had the exactly same problem but clearly you are smarter than me :slight_smile:

Yes, it’s “Continue”

So right click that, and paste it in the --callback.

I Knew the callback was what I needed to do, I just couldn’t find it. Thanks!

I’m in a bind. When I reached that “Open With” prompt, I clicked the box and told it to set this as default or “always use this to open”, and now it will never actually log me in. I have no idea if this is a browser/chrome setting or a Zorin setting.

I have no idea what I did, and even though I signed into my NordVPN, the terminal does not register as being logged in. I feel like I’ve ruined everything.

I just wanted a simple way to connect, like Windows and its GUI.

Thanks! I was stuck on how to get past this step and your answer is exactly what I needed!

Side note- the quote marks are very much required! I tried a few times until I realized I wasn’t wrapping the link in quotes. After adding them, it worked.

this worked for me! sheesh. norvpn documentation sucks