Could not open input file
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVPN User
- Posts: 25
- Joined: Mon Jul 12, 2021 2:31 pm
Could not open input file
Hi,
I set up an openvpn server with username/password authentication by adding auth-user-pass-verify line as below
auth-user-pass-verify "/usr/bin/php /home/www/domains/openvpn/scripts/login.php" via-env
I start the openvpn services by "sudo systemctl start openvpn-server@server.service". when I try to login, the log file complains "Could not open input file: /home/www/domains/openvpn/scripts/login.php", and the authentication fails.
I tried both
user nobody
group nobody
and
user root
group root
All have the same error. The /home/www/domains/openvpn/scripts/login.php exists.
I then run openvpn from command line as below, everything works perfectly.
sudo /usr/sbin/openvpn --config /etc/openvpn/server.conf
Can anyone show me how to handle this problem?
Thank you.
I set up an openvpn server with username/password authentication by adding auth-user-pass-verify line as below
auth-user-pass-verify "/usr/bin/php /home/www/domains/openvpn/scripts/login.php" via-env
I start the openvpn services by "sudo systemctl start openvpn-server@server.service". when I try to login, the log file complains "Could not open input file: /home/www/domains/openvpn/scripts/login.php", and the authentication fails.
I tried both
user nobody
group nobody
and
user root
group root
All have the same error. The /home/www/domains/openvpn/scripts/login.php exists.
I then run openvpn from command line as below, everything works perfectly.
sudo /usr/sbin/openvpn --config /etc/openvpn/server.conf
Can anyone show me how to handle this problem?
Thank you.
-
- OpenVPN User
- Posts: 25
- Joined: Mon Jul 12, 2021 2:31 pm
Re: Could not open input file
By the way, script-security is set to 3, as below:
script-security 3
script-security 3
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
-
- OpenVPN User
- Posts: 25
- Joined: Mon Jul 12, 2021 2:31 pm
Re: Could not open input file
Thank you TinCanTech. The Version is 2.4.11 under CentOS 8.TinCanTech wrote: ↑Mon Jul 12, 2021 3:05 pmWhich version of openvpn ?
Please start here:
viewtopic.php?f=30&t=22603
Strangely, I changed ProtectHome=true to ProtectHome=false in /etc/systemd/system/multi-user.target.wants/openvpn-server@server.service,
then it works.
I have no idea what it means. I just try everything and hit the trigger at this point (so you know how much time I have spent on this error). Anyone know what it is? I also used ddd to debug openvpn, but can't find the bug.
Thank you.
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Could not open input file
Moved to correct board.
Yes, it would.vicn1222 wrote: ↑Mon Jul 12, 2021 3:25 pmI changed ProtectHome=true to ProtectHome=false in /etc/systemd/system/multi-user.target.wants/openvpn-server@server.service, then it works.
If you want to use the proper openvpn-server@.service file then you cannot use /home for your server scripts.
-
- OpenVPN User
- Posts: 25
- Joined: Mon Jul 12, 2021 2:31 pm
Re: Could not open input file
Hi,.TinCanTech wrote: ↑Mon Jul 12, 2021 3:37 pm
Yes, it would.vicn1222 wrote: ↑Mon Jul 12, 2021 3:25 pmI changed ProtectHome=true to ProtectHome=false in /etc/systemd/system/multi-user.target.wants/openvpn-server@server.service, then it works.
If you want to use the proper openvpn-server@.service file then you cannot use /home for your server scripts.
Do you have a doc link that explains ProtectHome, or point me the source code file and line number, where I can get more information?
Thank you!
- openvpn_inc
- OpenVPN Inc.
- Posts: 1333
- Joined: Tue Feb 16, 2021 10:41 am
Re: Could not open input file
This might be of interest:
https://www.freedesktop.org/software/sy ... .exec.html
Hope this helps, regards, rob0
OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support
-
- OpenVPN User
- Posts: 25
- Joined: Mon Jul 12, 2021 2:31 pm
Re: Could not open input file
Thank you!openvpn_inc wrote: ↑Mon Jul 12, 2021 4:30 pmThis might be of interest:
https://www.freedesktop.org/software/sy ... .exec.html
Hope this helps, regards, rob0