Score:0

Ubuntu 22.04 OpenVPN config

tr flag

I have .ovpn file, exported from OpenVPN server:

dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA512
client
resolv-retry infinite
remote xxx.xxx.xxx.xxx 1194 udp
lport 0
verify-x509-name "C=xxx, ST=xxx, L=xxx, O=xxx, emailAddress=xxx@xxx.xxx, CN=xxx" subject
remote-cert-tls server
auth-user-pass auth.txt
comp-lzo adaptive
pkcs12 xxx.p12
tls-auth xxx-tls.key 1

Sure I have auth.txt, xxx.p12 and xxx-tls.key files, exported from the same OpenVPN server

Can anyone please explain me, what have I do to config client with this files on Ubuntu 22.04?

I've installed openvpn (apt-get install openvpn)

Put all the files to /etc/openvpn/client

Tried to openvpn --config /etc/openvpn/client/xxx.ovpn

Have an error Cannot pre-load keyfile (xxx-tls.key)

I'm not sure these steps are right...

pl flag
Does this answer your question? [How can I use a .ovpn file with Network Manager?](https://askubuntu.com/questions/187511/how-can-i-use-a-ovpn-file-with-network-manager)
Nickolay Khalaychidi avatar
tr flag
No, I have only ssh access, so I need to configure it with console
Score:0
tr flag

This was helpful for me:

  1. Export one .ovpn file from server instead of several:
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA512
client
resolv-retry infinite
remote xxx.xxx.xxx.xxx 1194 udp
lport 0
verify-x509-name "C=xxx, ST=xxx, L=xxx, O=xxx, emailAddress=xxx@xxx.xxx, CN=xxx" subject
remote-cert-tls server
auth-user-pass auth.txt
comp-lzo adaptive
<ca>
-----BEGIN CERTIFICATE-----
***DATA***
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
***DATA***
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
***DATA***
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
***DATA***
-----END OpenVPN Static key V1-----
</tls-auth>
key-direction 1
  1. Rename .ovpn file to client.conf
  2. Copy client.conf and auth.txt to /etc/openvpn
  3. Run systemctl start openvpn@client
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.