Authentication without a Server OS or Certificate

Scripts which allow the use of special authentication methods (LDAP, AD, MySQL/PostgreSQL, etc).

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Bionic711
OpenVPN User
Posts: 23
Joined: Wed Jan 19, 2011 7:40 pm

Authentication without a Server OS or Certificate

Post by Bionic711 » Thu Oct 06, 2011 8:31 pm

I don't have a server OS, just a 64-bit Win 7 Ultimate machine I run a server conf on. I transitioned it to a DD-WRT router where my main VPN lies.

However, I've noticed that several of my areas Hotspots don't like my certificates and their firewalls decline me to open my tunnel.

Now trying to create a second tunnel option with port forwarding on my PC again.

I'm thinking that if I use a Username and Pass authentication that it will go through.

However, my issue is I'm new to scripting as of today. I was suggested Powershell by someone, spent the entire day attempting to learn and came up with this.

$Username = gc "c:\\Program Files (x86)\\OpenVPN\\config\\Username.txt"
$Password = gc "c:\\Program Files (x86)\\OpenVPN\\config\\Password.txt"
if (($username -ceq $username1) -and ($password -ceq $password1)) {0}
elseif (($username -cne $username) -or ($username -cne $password)) {1}
else {1}

It's not finished as I have to add the variable for the client side submitted PW and UN.

This is the error I get.

Options warning: Bad backslash ('\') usage in SCRIPT-ARGV:0: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as "c:\\openvpn\\static.key"
Thu Oct 06 16:20:49 2011 us=978000 openvpn_execve: CreateProcess D:\OpenVPN\config\login.ps1 failed: %1 is not a valid Win32 application. (errno=193)
Thu Oct 06 16:20:49 2011 us=978000 WARNING: Failed running command (--auth-user-pass-verify): external program did not execute -- returned error code -1
Thu Oct 06 16:20:49 2011 us=978000 TLS Auth Error: Auth Username/Password verification failed for peer
Thu Oct 06 16:20:49 2011 us=978000 SIGTERM[soft,auth-control-exit] received, client-instance exiting
Thu Oct 06 16:20:49 2011 us=978000 MULTI: multi_close_instance called

I took out my networks IP addresses.

It's saying that my PS script is attempting to be read in a linux environment if I read it correctly?

Can anyone help with assisting me on learning how to setup a UN and PW.

The other thing I'm wondering if it's possible to store the UN and PW somewhere other than a file on the PC, such as in the server side Cert.

In addition, I'm having issue with getting the VPN to write to the tmp file (I have admin access, read only is off, same drive as openvpn, and directory has full control privileges). This error was brought after I changed it to the via-env. I also do not know how to make the script pull form the environment location.

Post Reply