Comments on How to install and configure OpenVPN Server on Debian 10

OpenVPN is open-source software that can be used to access the internet securely when connected to an untrusted network. In this tutorial, we will explain how to setup OpenVPN server on Debian 10 server.

21 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: mccharlet

Hi,

You don't need NAT in the configuration ?

By: Muhammad Arul

You just enabled NAT without Firewall configuration.

Is thats how openvpn works?

By: Pavel

AFTER:

apt-get install openvpn -y

YOU SHOULD RUN:

apt-get install easy-rsa

 

By: bari

hello, that's good. I have been sucess configure my server based your guide. for this time, how to access vpn server to windows client based this tutorial.?? i tried since yesterday, and did not get  a clue..

thank you

By: Walter

I was created as shell script that create a user client automaticaly

vim create_client.sh

#!/bin/bash

rm -f /etc/openvpn/easy-rsa/pki/private/client.key

./easyrsa gen-req client nopass

./easyrsa sign-req client client

input="/etc/openvpn/easy-rsa/pki/issued/client.crt"

while IFS= read -r line

do

  if [[ $line == *"Subject: CN="* ]]; then

    #echo "$line"

    linha=$line

  fi

done < "$input"

echo =====================================================

empty=""

nome_escolhido=${linha/Subject: CN=/$empty}

if [[ -z "$nome_escolhido" ]]; then

  nome_escolhido="novo_cliente"

fi

 

cp /etc/openvpn/easy-rsa/pki/issued/client.crt .

cp /etc/openvpn/easy-rsa/pki/private/client.key .

/usr/bin/tar -zvcf $nome_escolhido.tar.gz client.crt client.key ta.key ca.crt client.conf

rm client.crt client.key

 

By: Michael

Hi, first error on: sysctl -p

Command not found.

By: till

The sysctl command exist on every Debian 10 server. Maybe you are not logged in as root user or it's not a Debian 10 system or you mistyped the command.

By: Michael

No export lines in var

By: Carlos

Hi, when I'm in the client trying: scp [email protected]:/etc/openvpn/client/ca.crt /etc/openvpn/

I am asked the root password of the server, I write it, and I am sure I am doing It right but It says: permission denied, please try again.

Any idea of why this is happening?

Thank you very much

 

By: Carlos

Hello,

When im doing: scp [email protected]:/etc/openvpn/client/ca.crt /etc/openvpn/

I am asked to write the password of the root user of the server. I write it correctly but It says Permission denied, please try again.

Any idea of this problem?

Thank you

 

By: Brrng

Bonjour, je suis sous debian 10.2.0 et la commande sysctl -p ne passe pas. bash: sysctl: commande introuvable.

 

C'est la même chse pour openvpn --genkey --secret ta.key

By: habib ahmad purba

How do I configure it with a Windows client? Please..

By: Charlie

Do you have the command to genarate an client.ovpn profile to import to the windows open vpn client.

 

By: Pablo

changing the extension .conf for .ovpn will work.

By: Hackmond

Bro, you are the best! Thank you very much! I couldn't do that for several hours. Thanks!

By: Liviu

Hi, for those receiving the error: bash: openvpn: command not found

Most likely you used "su" instead of "su -".

just run: su -

and it should work.

By: caladev

This article is missing the NAT configuration step.

You can clearly see in the Centos version of this article there is a section on `iptables` config which does not exist here: https://www.howtoforge.com/tutorial/how-to-install-openvpn-on-centos-7/

Since on Debian the new preferred firewall app is not `iptables` but rather `nftables`, the following configuration example should hopefully help someone in the same position as me that followed this from start to finish and it only worked after I configured NAT correctly.

Example with `nftables`: https://github.com/mqus/nft-rules/blob/master/files/VPN.md

By: nab

scp [email protected] : /etc/openvpn/client/ca.crt / etc / openvpn / pour ce pbm il faut autoriser root pour ssh:https://cloriou.fr/2016/12/05/debian-autoriser-acces-root-via-ssh/

By: Stefan

Who needs to make an .ovpn do like this:

- nano /etc/openvpn/client.ovpn

- put in the content made for client.conf

- at the end add <ca> and save

- cat client/ca.crt >> ./client.ovpn

- add </ca> and <cert> and save

- cat client/client.crt >> ./client.ovpn

- delete the new added lines which are before -----BEGIN CERTIFICATE-----

- add </cert> and <key> and save

- cat client/client.key >> ./client.ovpn

- add </key>

 

Now it should work with Android, Windows etc.

By: Richard

Can you please update the above to include how to revoke a certificate ? 

By: Cs

Hi,

The tutorial is great!!

I successfully installed it on server and on client too. When I am starting openvpn client on my laptop, it connects, but my laptop internet goes away.

Could you help me in this?