|# Default Variable Declarations|
|#Ask for a Client name|
|echo "Please enter an existing Client Name:"|
|#1st Verify that client’s Public Key Exists|
|if [ ! -f $NAME$CRT ]; then|
|echo "[ERROR]: Client Public Key Certificate not found: $NAME$CRT"|
|echo "Client’s cert found: $NAME$CR"|
|#Then, verify that there is a private key for that client|
|if [ ! -f $NAME$KEY ]; then|
|echo "[ERROR]: Client 3des Private Key not found: $NAME$KEY"|
|echo "Client’s Private Key found: $NAME$KEY"|
|#Confirm the CA public key exists|
|if [ ! -f $CA ]; then|
|echo "[ERROR]: CA Public Key not found: $CA"|
|echo "CA public Key found: $CA"|
|#Confirm the tls-auth ta key file exists|
|if [ ! -f $TA ]; then|
|echo "[ERROR]: tls-auth Key not found: $TA"|
|echo "tls-auth Private Key found: $TA"|
|#Ready to make a new .opvn file - Start by populating with the|
|cat $DEFAULT > $NAME$FILEEXT|
|#Now, append the CA Public Cert|
|echo "<ca>" >> $NAME$FILEEXT|
|cat $CA >> $NAME$FILEEXT|
|echo "</ca>" >> $NAME$FILEEXT|
|#Next append the client Public Cert|
|echo "<cert>" >> $NAME$FILEEXT|
|cat $NAME$CRT | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >> $NAME$FILEEXT|
|echo "</cert>" >> $NAME$FILEEXT|
|#Then, append the client Private Key|
|echo "<key>" >> $NAME$FILEEXT|
|cat $NAME$KEY >> $NAME$FILEEXT|
|echo "</key>" >> $NAME$FILEEXT|
|#Finally, append the TA Private Key|
|echo "<tls-auth>" >> $NAME$FILEEXT|
|cat $TA >> $NAME$FILEEXT|
|echo "</tls-auth>" >> $NAME$FILEEXT|
|echo "Done! $NAME$FILEEXT Successfully Created."|
|#Script written by Eric Jodoin|
|\ No newline at end of file|
Based on your document at http://readwrite.com/2014/04/11/building-a-raspberry-pi-vpn-part-two-creating-an-encrypted-client-side#awesm=~oBCBdzyUX8lr5v, should DEFAULT="Defaults.txt" actually be DEFAULT="default.txt"
I keep getting this error when I run the script:
Here's line 45, 46 & 47:
Ready to make a new .opvn file - Start by populating with the
Should default file be on line 45?
Have the same problem as Andrew above:
"Please enter an existing Client Name:
Also it didn't like the last sentence on the script stating
"./MakeOPVN.sh: line 60: No:command not found!."
So I simply deleted everything on that line apart from ""
I have a problem when I run ./MakeOPVN.sh
I figured out the error for TLS.
I accidentally wrote my script to look for a file called ta.crt
Check to see if you made the same mistake.
Hope this helps!
I fixed a few issues with the script:
I also made the white space consistent.
This appears to work for me but when I run it it asks me to enter the client name which I do. It then displays
Then just appears to hang. Is anyone able to point me in the right direction of what may have gone wrong please? Thanks
Hi everyone, hopefully I'm not to late to the party, as I've got an issue with mine.
I have everything to work, and corrected the errors as mentioned above. However I get the following below.
Please enter an existing Client Name:
It says it has done it successfully, but I don't understand the cat: default.text error?
Any helps greatly appreciated , thanks.
Hi guys! Sorry I am still a Linux noob and just can't find the problem with the script.
I was using the latest script, however I keep on getting the following error:
Please enter an existing Client Name:
However, the client1.crt file is located in the /keys folder.
Any ideas? Thank you very much!
I'm busy following the tutorial now, and encountered the same problem you did - the key existed in the folder, but ./MakeOVPN.sh returned Client Public Key Certificate not found.
I ended up succeeding, but I don't know what of the following worked. In order -
I suspect I was either no in the right directory, or that the Pi needed a reboot for something to take effect.
Hope it works for you!
It was step 5 that did if for you. If you weren't in the right directory, it wouldn't be able to find those files since the script is set up to look in the current working directory only for those files. You could hardcode the full path if you wanted to be able to run the script from elsewhere.
Hi Lauren and others
Thank you very much for your code and tutorial!!!
Commented out 2 lines that kept throwing an error.
just followed this, i think using the latest script posted by trumpy
got "PolarSSL cert certificate is undefined" from my iphone
its because my Default.txt file needed a line break at the end (Or another script update)
This is what got me passed the ta.key not found problem. Little weary that the first part of the installation did not do something it should of, but now I have a .ovpn file.
For some reason I did not have a ta.key file in the first place so I ran this
openvpn --genkey --secret /etc/openvpn/easy-rsa/keys
this will create the ta.key...
Using the scripts changes from coolaj86 and running the script from /etc/openvpn/easy-rsa/keys worked.
It created my .ovpn file.
On to the next step, hope that helps...