20

following the instructions on the official vpn page (instructions install openvpn client) in the second step:

# curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg

I get the following error message:

sudo curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg
-bash: /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg: Permission denied
(23) Failed writing body
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
grafeno30
  • 479
  • 1
  • 5
  • 17

2 Answers2

38

I had a similar issue recently. Use

sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub

and

sudo apt-key add openvpn-repo-pkg-key.pub

Reference - https://openvpn.net/cloud-docs/openvpn-3-client-for-linux/

  • Hello Danny,
    I would like to execute client linux openvpn:
    openvpn --config ~/.ssh/vpnbook-us1-tcp443.ovpn
    Is it right?
    I have found a file of type openvpn from book:
    [link](https://www.vpnbook.com/)
    Do I have to create my own file?

    I have seen the content of this type of file:
    dev tun1
    proto tcp
    remote 198.7.62.204 443
    remote us1.vpnbook.com 443
    resolv-retry infinite

    How do I start the openvpn client in linux (ubuntu)? I already have everything installed

    Thanks in advance
    – grafeno30 Oct 26 '21 at 17:37
  • sorry I do not know how I could put new lines in comments. Sorry! – grafeno30 Oct 26 '21 at 17:40
  • 1
    Login to the VPN server page. There you have to download client.ovpn (User Lock Profile/Auto Login Profile) file from server. To connect the VPN, use the command, openvpn3 session-start --config path/to/client.ovpn – Danny Hamshananth Oct 27 '21 at 18:17
  • It isn't clear to me that these two commands above replace "curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg" but this so far seems to work. I haven't tried using the OpenVPN Client yet, though, so take that with a grain of salt. – ErikS Feb 06 '22 at 19:30
  • 4
    I'm seeing this message - `Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).` – alphabet5 Mar 01 '22 at 15:58
  • Unable to locate package openvpn3 - even after doing this. Anyone know how else to get openvpn3 on Ubuntu 20.04? Having the same issues as OP. – j7skov Sep 01 '22 at 17:38
  • @alphabet5 and others using apt-key is outdated and insecure. Run the openvpn install commands via root, not sudo. – Z.Davey Sep 25 '22 at 19:44
1

The tutorial you posted is still valid, but as it was pointed out in the comments, you have to run the commands as superuser (I just tested sudo but it wouldn't work either).

Moreover, apt-key is mostly deprecated, so be careful with the accepted solution. If you follow the steps there, you will get a deprecation warning every time you run apt update.

Le Sir Dog
  • 95
  • 1
  • 10