12

I have been able to add the repo and install the nordvpn package from apt. However, when attempting to log in from the command line, I get the following:

$ sudo nordvpn login
Continue in the browser: https://zwyr157wwiu6eior.com/v1/users/oauth/login-redirect?attempt=a6d25b0a-06d6-402c-af15-908d0627644a

The link redirects to the Nord VPN login on the browser, which I am able to successfully do, however when it attempts to redirect to the NordVPN app, nothing happens. Selecting the NordVPN app from the applications list in the side bar does not successfully start the application either.

The last time I tried logging in from another linux PC I was able to login directly from the command line without any issues. Any ideas on what I'm missing?

zimmerj
  • 133
  • 1
  • 1
  • 4

8 Answers8

26

nordvpn help login will give you hints.

The default browser based login worked for me, but instead of opening the link at the success page, I copied the nordvpn://... url (or replaced https:// with nordvpn:// to build the URL), and finished logging in in the console by using nordvpn login --callback "nordvpn://success-uri-I-copied-from-browser".

After this, login was successful.

MewX
  • 105
  • 3
Ercinee
  • 361
19

I had the same problem and found a solution in this forum: https://discourse.lubuntu.me/t/how-to-setup-nordvpn/2958/3

The gist is: you can use nordvpn login --legacy​ in order to avoid the browser.

PiFlavour
  • 306
  • 2
  • 2
  • Thanks, this worked. Also mentioned in the link you provide, is that the CLI tool doesn't work with MFA. – zimmerj Jan 05 '22 at 04:57
  • 1
    I can't speak highly enough for nordvpn's support in my experience, but I did complain about the need to login through a browser, necessarily without vpn, to login to the vpn. thanks for the yip. another hidden nordvpn feature. – pierrely Jan 07 '22 at 09:34
  • you can also get stuck with the nordvpn killswitch set to on and for whatever reason that doesn't work, ubuntu cannot login to internet at all, or you cannot ping as dns resolv issue. you need to set killswitch off. – pierrely Jan 07 '22 at 09:35
  • Thanks, that's good to know. I also found that, in my case, I had to change the protocol setting to TCP after install. Everything has been working great after that, except I can't get the GUI to work. But I prefer CLI anyway. – zimmerj Jan 13 '22 at 03:43
  • 1
    outdated and doesn't work as of 9 August, 2023. – user2989643 Aug 09 '23 at 10:50
7

Although the previous answers may have worked before they do not work as of 9 August, 2023. The new way to login via the Ubuntu CLI is to use the --token flag: nordvpn login --token <your generated token from the portal>

In order to get the generated token you need to login to your NordVPN account portal, then head on to Nord VPN -> scroll down until you see Set up Nord VPN manually -> complete MFA steps here -> Then under Access Token generate a new Token -> setup the Expiry date (either 30 days or never) -> Copy and Close.

After that you may use the nordvpn login --token <generated token>.

Hope this is helpful.

Cheers!!

1

Alternatively you can ...:

  1. Visit OpenVPN configuration files
  2. Download the specific OpenVPN configuration file which fits to your needs.
  3. In Ubuntu open Settings/Network in the section VPN press the + button.
  4. Import the downloaded configuration file and add your NordVPN credentials in the appearing dialog.
  5. Now you should see a new entry in the VPN section. Activate the new VPN connection by clicking on the slider.

The advantage of this method is, you don't need to install any third party software and it works without any complications.

0

I got the same issue, use the login flags provided :

 $ sudo nordvpn login --username YOURUSERNAME --password PASSWORDPLAINTEXT
James
  • 1
0

From 2023, you need to use the token function. Go to your NordVPN private account page and generate a token (https://my.nordaccount.com/dashboard/nordvpn/manual-configuration/authorize/). You can pass it to the nordvpn cli with --token flag

0

As of Nov 26, 2023: Accepted answer does not work anymore, this snippet nordvpn login --legacy, will result in an error Incorrect Usage: flag provided but not defined: -legacy

For anyone who is looking for this, After logging in to NordVPN website, right click on Continue button then copy the link address.

Now run following command:

sudo nordvpn login --callback "<copied link address>"

This will let you login, for me when I was clicking the Continue button in the browser it was redirecting me to another terminal and was throwing following error:

Permission denied accessing /run/nordvpn/nordvpnd.sock.
Run 'usermod -aG nordvpn $USER' to fix this issue and log out of OS afterwards for this to take an effect.
0

Follow the browser based login procedure using nordvpn login. After successful login when the "OpenNordVPN" dialog is shown, copy the URL and decode it (using online url decode tools). Then replace the https at the begining of the URL with nordvpn. Now you can use it for the nordvpn login --callback.