pontypool
Posts: 128
Joined: Thu Apr 10, 2014 1:18 pm

vpns and torrenting

Sat Feb 27, 2016 2:32 pm

I have an account with private internet access, so want to use it to try using my pi2 as an always on torrent box.
~I came across these instructions.

https://dotslashnotes.wordpress.com/201 ... pberry-pi/

1. If you don’t have done this already, you need to install OpenVPN.

sudo apt-get install openvpn DONE

2. Move to the OpenVPN directory in /ect: DONE

cd /etc/openvpn DONE

3. Download from the Private Internet Access website the zip folder. This folder contains all the config files for OpenVPN. DONE

wget https://www.privateinternetaccess.com/o ... penvpn.zip

4. Unzip the folder using unzip. If you don’t have unzip already installed in your system run the following command:

sudo apt-get install unzip WAS ALREADY INSTALLED

and then unzip:

sudo unzip openvpn.zip DONE UNZIPPED BY RIGHT CLICK EXTRACT HERE
5. In order to see the list of servers to which you can connect run:

ls -l TYPED THIS AND TERMINAL SAYS -rwxr-xr-x 1 root root 1301 Jan 23 23:17 update-resolv-conf

6. As you can see each server config file has .ovpn extension. Now you can run the final command to connect to the server:

sudo openvpn config-sever-filename.ovpn NOTHING SEEMS TO HAPPEN, I ASSUME YOU REPLACE "FILENAME" WITH A SERVER FOR EXAMPLE "NETHERLANDS" SO I ENTERED sudo openvpn config-sever-NETHERLANDS.ovpn TERMINAL SAYS.. Options error: In [CMD-LINE]:1: Error opening configuration file: config-sever-Netherlands.ovpn


Once the previous command is executed you are required to insert your username and password of your Private Internet Access account. If you want to avoid to insert username and password every time you want to connect to the VPN you can follow these steps:

1. Create a .txt file in the /etc/openvpn folder (same folder of the .ovpn file) . You can name this file ‘pass.txt‘
2. In the first two lines of the file put your username and password, like:

username

password

3. Save and close the file.
4. Open up your .ovpn and add the following line at the bottom:

auth-user-pass pass.txt

5. Save and try to connect again. You should not be required to insert username and password this time.

That’s it.

In a next post I will show how to connect automatically to the VPN at boot.


Please help !?

pontypool
Posts: 128
Joined: Thu Apr 10, 2014 1:18 pm

Re: vpns and torrenting

Sat Feb 27, 2016 7:36 pm

anyone up? : )

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Sat Feb 27, 2016 11:42 pm

Ok, it was a little tricky to get working for me
First thing when your are listing your filenames the " ls -l" command. It should show about 50 different .ovpn so my guess is thay you are not in the right directory, where you unzipped the
.ovpn files too.

pontypool
Posts: 128
Joined: Thu Apr 10, 2014 1:18 pm

Re: vpns and torrenting

Sun Feb 28, 2016 11:09 am

i tried moving those files into the openvn directory. but i don't have permission. i changed write and read to everyone, but pi, still owns the file. keep getting errors trying to move. i created a new thread asking how i do this, because a search didn't turn up anything i understood, only some terminal command that worked on an individual file. hmm

i made this thread, because i can't get the contents of the openvpn.zip into the openvpn directory at etc/openvpn

viewtopic.php?f=91&t=137751&p=915059

anyone??

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Mon Feb 29, 2016 4:41 pm

Did you use sudo mv to try to move the file. Sound like you are not running the commands as root Also the ovpn file can be anywhere on the file systen. It does not have to be in /etc/openvpn. Cd to the directory that the .ovpn files are in and Just do
sudo openvpn /path/to/file.ovpn.

Example. My ovpn files are in my home folder

I would
cd /home/pi
Sudo openvpn /home/pi/pia.ovpn
Last edited by Jsnow0187 on Mon Feb 29, 2016 4:46 pm, edited 1 time in total.

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Mon Feb 29, 2016 4:43 pm

Also the .ovpn filea are long and a pain so i renamed the one i was using to pia.ovpn. also u nay have to edit the ovpn file to specify your name. Do this by sudo nano /path/to/file.ovpn

pontypool
Posts: 128
Joined: Thu Apr 10, 2014 1:18 pm

Re: vpns and torrenting

Mon Feb 29, 2016 6:58 pm

sorry, but I don't understand what you're saying/asking.
I have the files in my downloads folder, i unzipped the configuration zip file from privateinternetaccess.com i extracted the files which contain servers for different countries etc.. netherlands usacalifornia etc etc etc
I want to move the files into the openvpn directory which is /etc/openvpn... i cannot do this as I don't have permissions, so I wanted to move these files into that directory.
If I hear you correctly, I can follow the tutorial I posted and just point it to the downloads folder as that contains the servers??? I will try that, but would still like to know how I can move the files anyway, as it would be useful to learn and I may encounter another problem with moving files in the future. besides which, having to keep app files in seperate locations to the main directory will become cluttered and confusing as I start installing things.

I created this thread trying to figure out how to move the files
viewtopic.php?f=91&t=137751&p=915059

So far none of the commands posted have worked?? I have no idea why, I posted exactly what I tried and what feedback I got back, nothing works??

edit. i am accessing the configuration files now. so i've got to the next step, but opening one of the servers, namely Netherlands.opvn I have another error.. as follows.any ideas why It cannot open the netherlands config file? I am the owner permissions allow for change by anyone?? so what now?? : /

pi@raspberrypi:/etc/openvpn $ ls -l
total 152
-rwxrwxrwx 1 pi pi 238 Dec 5 03:04 AU Melbourne.ovpn
-rwxrwxrwx 1 pi pi 228 Dec 5 03:04 AU Sydney.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 Brazil.ovpn
-rwxrwxrwx 1 pi pi 1395 Dec 5 03:04 ca.crt
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 CA North York.ovpn
-rwxrwxrwx 1 pi pi 235 Dec 5 03:04 CA Toronto.ovpn
-rwxrwxrwx 1 pi pi 577 Dec 5 03:04 crl.pem
-rwxrwxrwx 1 pi pi 232 Dec 5 03:04 Denmark.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 France.ovpn
-rwxrwxrwx 1 pi pi 232 Dec 5 03:04 Germany.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 Hong Kong.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 India.ovpn
-rwxrwxrwx 1 pi pi 232 Dec 5 03:04 Ireland.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 Israel.ovpn
-rwxrwxrwx 1 pi pi 230 Dec 5 03:04 Italy.ovpn
-rwxrwxrwx 1 pi pi 230 Dec 5 03:04 Japan.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 Mexico.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 Netherlands.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 New Zealand.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 Norway.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 Romania.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 Russia.ovpn
-rwxrwxrwx 1 pi pi 227 Dec 5 03:04 Singapore.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 Sweden.ovpn
-rwxrwxrwx 1 pi pi 230 Dec 5 03:04 Switzerland.ovpn
-rwxrwxrwx 1 pi pi 231 Dec 5 03:04 Turkey.ovpn
-rwxrwxrwx 1 pi pi 234 Dec 5 03:04 UK London.ovpn
-rwxrwxrwx 1 pi pi 239 Dec 5 03:04 UK Southampton.ovpn
-rwxr-xr-x 1 pi pi 1301 Jan 23 23:17 update-resolv-conf
-rwxrwxrwx 1 pi pi 238 Dec 5 03:04 US California.ovpn
-rwxrwxrwx 1 pi pi 232 Dec 5 03:04 US East.ovpn
-rwxrwxrwx 1 pi pi 235 Dec 5 03:04 US Florida.ovpn
-rwxrwxrwx 1 pi pi 235 Dec 5 03:04 US Midwest.ovpn
-rwxrwxrwx 1 pi pi 239 Dec 5 03:04 US New York City.ovpn
-rwxrwxrwx 1 pi pi 235 Dec 5 03:04 US Seattle.ovpn
-rwxrwxrwx 1 pi pi 241 Dec 5 03:04 US Silicon Valley.ovpn
-rwxrwxrwx 1 pi pi 233 Dec 5 03:04 US Texas.ovpn
-rwxrwxrwx 1 pi pi 232 Dec 5 03:04 US West.ovpn
pi@raspberrypi:/etc/openvpn $ sudo openvpn config-sever-Netherlands.ovpn
Options error: In [CMD-LINE]:1: Error opening configuration file: config-sever-Netherlands.ovpn
Use --help for more information.

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Tue Mar 01, 2016 11:13 am

You dont need to put config-server

Your command just needa to be

Sudo openvpn Netherlands.ovpn

Sorry for my confusing posts, i am not the best teacher/explainer

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Tue Mar 01, 2016 11:14 am

Also what do you get when your run the command.

Sudo mv Netherlands.ovpn

pontypool
Posts: 128
Joined: Thu Apr 10, 2014 1:18 pm

Re: vpns and torrenting

Tue Mar 01, 2016 6:36 pm

Jsnow0187 wrote:Also what do you get when your run the command.

Sudo mv Netherlands.ovpn

actually, you're a lot better than you think : P
i am actually connected now, i should have replaced the whole server-filename txt but was only replacing the "filename" part.
the only part im stuck on now, is the final bit trying to save the username and password so it connects automatically and i dont have to keep entered the username pass everytime.

i created a txt file called it pass.txt entered my username on the first line and password on the 2nd.
this is what happens when i follow the commands.

pi@raspberrypi:/etc/openvpn $ auth-user-pass pass.txt
bash: auth-user-pass: command not found
pi@raspberrypi:/etc/openvpn $

ill keep fiddling with it, but cant see why its not working
Last edited by pontypool on Tue Mar 01, 2016 6:55 pm, edited 1 time in total.

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Tue Mar 01, 2016 6:39 pm

sudo should be lowecase. Linux is picky when it comes to case. To edit the config file. sudo nano Netherlands.ovp

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Tue Mar 01, 2016 6:40 pm

sudo is a command to execute commands as root/super user.

My advice would be to read a few tutorials on basic linux command line usage. Looks like you need to get familiar with different commanda

pontypool
Posts: 128
Joined: Thu Apr 10, 2014 1:18 pm

Re: vpns and torrenting

Tue Mar 01, 2016 7:27 pm

ahhh i figured it out. as i had already connected. after saving the pass.txt and trying to connect, i got errors, cause it was already connected, restarting the pi and connecting via netherlands the password and username auto filled in and worked. thx

Jsnow0187
Posts: 16
Joined: Sat Feb 27, 2016 11:36 pm

Re: vpns and torrenting

Tue Mar 01, 2016 7:32 pm

glad you got it figured out. If tou ever wanto to stop the vpn,

sudo killall openvpn

Will do it.

Return to “Advanced users”