client-connect unknown error (errno=193)

How to customize and extend your OpenVPN installation.

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

Post Reply
cacamille3
OpenVpn Newbie
Posts: 13
Joined: Tue Apr 28, 2020 11:36 am

client-connect unknown error (errno=193)

Post by cacamille3 » Fri Nov 27, 2020 10:57 am

Hi,

I have some issue using client-connect script.
I just wrote a test script that contains the following code:

Code: Select all

#!/bin/bash
exit 0
My Server configuration contains the following:

Code: Select all

script-security 2
client-connect "C:\\cc_static_ip.sh"
Every time a Client is trying to connect I see the following error:
env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
openvpn_execve: CreateProcess C:\cc_static_ip.sh failed: Unknown error (errno=193)
WARNING: Failed running command (--client-connect): external program did not execute -- returned error code -1
What I am doing wrong ???

cacamille3
OpenVpn Newbie
Posts: 13
Joined: Tue Apr 28, 2020 11:36 am

Re: client-connect unknown error (errno=193)

Post by cacamille3 » Fri Nov 27, 2020 11:44 am

When I rename the file as *.bat this is then working...
I could run the script file as *.sh without error in a Command Prompt on this computer....

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: client-connect unknown error (errno=193)

Post by TinCanTech » Fri Nov 27, 2020 4:34 pm

Openvpn needs to know what ever the interpreter is you use for bash.

Code: Select all

client-connect "/path/to/sh.exe C:\\cc_static_ip.sh"
Whatever sh.exe is .. ?

cacamille3
OpenVpn Newbie
Posts: 13
Joined: Tue Apr 28, 2020 11:36 am

Re: client-connect unknown error (errno=193)

Post by cacamille3 » Mon Nov 30, 2020 2:48 pm

Ok thanks for the info.
I have updated my script to a batch script file that now works under windows.

Post Reply