Error opening configuration file etc openvpn server conf



OpenVPN Support Forum

Community Support Forum

Options error: In [CMD-LINE]:1: Error opening configuration file: server.conf

Options error: In [CMD-LINE]:1: Error opening configuration file: server.conf

Post by kaushalshriyan » Sun Nov 01, 2020 5:32 am

I have upgraded openvpn 2.4.9 (openvpn-2.4.9-1.el7.x86_64) to openvpn-2.5.0-1.el7.x86_64 on CentOS Linux release 7.8.2003 (Core) by referring to https://copr.fedorainfracloud.org/coprs . n-release/

OpenVPN 2.5.0 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Oct 28 2020
library versions: OpenSSL 1.0.2k-fips 26 Jan 2017, LZO 2.06
Originally developed by James Yonan
Copyright (C) 2002-2018 OpenVPN Inc
Compile time defines: enable_async_push=yes enable_comp_stub=no enable_crypto_ofb_cfb=yes enable_debug=yes enable_def_auth=yes enable_dependency_tracking=no enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=yes enable_fragment=yes enable_iproute2=no enable_libtool_lock=yes enable_lz4=yes enable_lzo=yes enable_management=yes enable_multihome=yes enable_pam_dlopen=no enable_pedantic=no enable_pf=yes enable_pkcs11=yes enable_plugin_auth_pam=yes enable_plugin_down_root=yes enable_plugins=yes enable_port_share=yes enable_selinux=yes enable_shared=yes enable_shared_with_static_runtimes=no enable_silent_rules=yes enable_small=no enable_static=yes enable_strict=no enable_strict_options=no enable_systemd=yes enable_werror=no enable_win32_dll=yes enable_x509_alt_username=yes with_aix_soname=aix with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_sysroot=no

I am mentioning the /etc/openvpn/server.conf configuration file which is as below :-

#
server 10.8.0.0 255.255.255.0
verb 3
key /etc/openvpn/server.key
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
dh /etc/openvpn/dh.pem
keepalive 10 120
persist-key
persist-tun
push «redirect-gateway def1»
push «dhcp-option DNS 8.8.8.8»
push «dhcp-option DNS 8.8.4.4»
push «route 192.168.0.0 255.255.255.0»
duplicate-cn
user nobody
group nobody

proto tcp
port 1195
dev tun
status /var/log/openvpn-status.log 60
status-version 2
log-append openvpn.log

While restarting OpenVPN server using systemctl restart openvpn-server@server.service command on CentOS Linux release 7.8.2003 (Core), I am encountering the below issue as shown in /var/log/messages file.

#systemctl status openvpn-server@server.service
● openvpn-server@server.service — OpenVPN service for server
Loaded: loaded (/usr/lib/systemd/system/openvpn-server@.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2020-11-01 10:58:11 IST; 1s ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/w . n24ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 3990 ExecStart=/usr/sbin/openvpn —status %t/openvpn-server/status-%i.log —status-version 2 —suppress-timestamps —cipher AES-256-GCM —ncp-ciphers AES-256-GCM:AES-128-GCM:AES-256-CBC:AES-128-CBC:BF-CBC —config %i.conf (code=exited, status=1/FAILURE)
Main PID: 3990 (code=exited, status=1/FAILURE)

Nov 01 10:58:11 openvpn.digitalapicraft.com systemd[1]: Failed to start OpenVPN service for server.
Nov 01 10:58:11 openvpn.digitalapicraft.com systemd[1]: Unit openvpn-server@server.service entered failed state.
Nov 01 10:58:11 openvpn.digitalapicraft.com systemd[1]: openvpn-server@server.service failed.

Any help will be highly appreciated. Thanks in Advance. Please let me know if you need any additional details.

Источник

FIX — Error opening configuration file: server.conf #654

Comments

Recurring problem on fresh Centos 7 installations:

service openvpn@server status -l
Redirecting to /bin/systemctl status -l openvpn@server.service
● openvpn@server.service — OpenVPN Robust And Highly Flexible Tunneling Application On server
Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2019-09-12 20:04:37 EDT; 17s ago
Process: 11239 ExecStart=/usr/sbin/openvpn —cd /etc/openvpn/ —config %i.conf (code=exited, status=1/FAILURE)
Main PID: 11239 (code=exited, status=1/FAILURE)

Sep 12 20:04:37 server.masked.com systemd[1]: Starting OpenVPN Robust And Highly Flexible Tunneling Application On server.
Sep 12 20:04:37 server.masked.com openvpn[11239]: Options error: In [CMD-LINE]:1: Error opening configuration file: server.conf
Sep 12 20:04:37 server.masked.com openvpn[11239]: Use —help for more information.
Sep 12 20:04:37 server.masked.com systemd[1]: openvpn@server.service: main process exited, code=exited, status=1/FAILURE
Sep 12 20:04:37 server.masked.com systemd[1]: Failed to start OpenVPN Robust And Highly Flexible Tunneling Application On server.
Sep 12 20:04:37 server.masked.com systemd[1]: Unit openvpn@server.service entered failed state.
Sep 12 20:04:37 server.masked.com systemd[1]: openvpn@server.service failed.

Читайте также:  Machine check exception lenovo

The text was updated successfully, but these errors were encountered:

Источник

OpenVPN Support Forum

Community Support Forum

Error opening configuration file:

Error opening configuration file:

Post by pinguim007 » Wed Apr 27, 2011 3:36 am

helo I had to remake my server and I am using a different interface on my client. I would like to known why I am receiving this error on my logs?

What sould I do, the openvpn I am using is the last one from yum installer and I am using the same Ip address on the new interface.

Re: Error opening configuration file:

Post by janjust » Wed Apr 27, 2011 6:21 am

where » » is the path to your config file (a good place to start looking is /etc/openvpn.

which Linux distro are you using?

Re: Error opening configuration file:

Post by pinguim007 » Wed Apr 27, 2011 6:44 am

rRe: Eror opening configuration file:

Post by pinguim007 » Wed Apr 27, 2011 8:25 am

sorry, but when I give —config parameter it works. but When I command service openvpn start; gives me this error at /var/log/messages
openvpn[3230]: Options error: In [CMD-LINE]:1:Eror opening configuration file:

I am using a centos.

On debian .conf works well should I have another .conf like .cfg or something on centos?
Why is it not reading my .conf?

what kind of permission should I set for the configuration file on centos and what Owner?

can somebody help me?

Re: Error opening configuration file:

Post by janjust » Wed Apr 27, 2011 10:46 am

to start openvpn on the command line you always need to specify ‘—config’. this is true for Debian also. What might happen on Debian is that a wrapper script is present which does this for you.

When you install OpenVPN on CentOS (which I use regularly) you can use the /etc/init.d/openvpn script to start openvpn as a service; this script picks up all configuration files from /etc/openvpn/*.conf

Re: Error opening configuration file:

Post by pinguim007 » Wed Apr 27, 2011 7:48 pm

I was believing on that too, but When I restart the service gives me this error.

I have on my configuration the parameter cd /etc/openvpn/ is that correct?

It works on debian.

do you known why is not getting up the .conf?

Re: Error opening configuration file:

Post by janjust » Wed Apr 27, 2011 9:29 pm

if openvpn works from the commandline but not as a service then there’s something wrong with your /etc/openvpn files ; there’s no need to use ‘cd /etc/openvpn’ inside an openvpn config file, as long as you use absolute paths to the certificate and key files.

Читайте также:  Null pointer exception in java strings

If the openvpn service does not work then check the /var/log/messages file for any warnings/errors (other than ‘cannot open config file’).

As a final debugging trick you can run

Re: Error opening configuration file:

Post by pinguim007 » Thu Apr 28, 2011 12:20 am

Re: Error opening configuration file:

Post by pinguim007 » Thu Apr 28, 2011 2:04 am

it is not giving me any more logs and even reading the parameters log, log-append and staus. it is only giving me when I execute openvpn —config parameter.
I will reinstall the operational system and later try again, if I have the same problem I will post more questions.

thank you very much

Re: Error opening configuration file:

Post by pinguim007 » Fri Apr 29, 2011 1:28 am

Re: Error opening configuration file:

Post by janjust » Fri Apr 29, 2011 8:13 am

Re: Error opening configuration file:

Post by scott.tanner » Fri Jul 27, 2012 4:11 am

Sorry for reopening an old thread, but I just had a similar issue and found this post while searching for an answer.

For me, it seems selinux (in enforcing mode) was blocking the init script from running, but allowing root to start the process from command line. Once I changed /etc/sysconfig/selinux to passive mode and rebooted, the init script started working.

Источник

Почему не стартует OpenVPN

Всю голову поломал не могу понять что ему нужно пишу в консоли: /etc/init.d/openvpn start
В ответ получаю
[ ok ] Starting openvpn (via systemctl): openvpn.service.
Смотрю в процессах нет никакого намека на него. Иду дальше
запращиваю статус systemctl status openvpn
В ответ получаю
openvpn.service — OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled) Active: active (exited) since Пт 2016-07-08 15:59:45 CEST; 1min 11s ago Process: 32548 ExecStart=/bin/true (code=exited, status=0/SUCCESS) Main PID: 32548 (code=exited, status=0/SUCCESS) CGroup: /system.slice/openvpn.service

июл 08 15:59:45 server systemd[1]: Started OpenVPN service. июл 08 15:59:52 server systemd[1]: Started OpenVPN service.
Делаю поиск по pidу
ps axu | grep 32548
В ответ получаю
root 556 0.0 0.0 14444 980 pts/0 S+ 16:02 0:00 grep 32548
Смотрю syslog
Jul 8 16:04:27 server systemd[1]: Stopping OpenVPN service.
Jul 8 16:04:27 server systemd[1]: Starting OpenVPN service.
Что ему надо подскажите

смотри openvpn.log (который указан в conf файле), либо запусти напрямую в консоли.

И всё у тебя будет пучком

В ответ получил
● openvpn@server.service — OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled)
Active: failed (Result: exit-code) since Пт 2016-07-08 16:27:37 CEST; 6s ago
Process: 2540 ExecStart=/usr/sbin/openvpn —daemon ovpn-%i —status /run/openvpn/%i.status 10 —cd /etc/openvpn —config /etc/openvpn/%i.conf (code=exited, status=1/FAILURE)
июл 08 16:27:37 server systemd[1]: openvpn@server.service: control process exited, code=exited status=1
июл 08 16:27:37 server systemd[1]: Failed to start OpenVPN connection to server.
июл 08 16:27:37 server systemd[1]: Unit openvpn@server.service entered failed state.

Читайте также:  Ошибка при включении компьютера post error

Он пустой в том то и дело

Конфиг лежит в /etc/openvpn/server.conf ?

запусти вручную openvpn —config /path/to/openvpn.conf

Я понял про конфиг уже, переименовал вот что щас пишет
● openvpn@server.service — OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled)
Active: failed (Result: exit-code) since Пт 2016-07-08 16:32:18 CEST; 1min 48s ago
Process: 2947 ExecStart=/usr/sbin/openvpn —daemon ovpn-%i —status /run/openvpn/%i.status 10 —cd /etc/openvpn —config /etc/openvpn/%i.conf (code=exited, status=1/FAILURE)

июл 08 16:32:18 server ovpn-server[2947]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/server.conf
июл 08 16:32:18 server systemd[1]: openvpn@server.service: control process exited, code=exited status=1
июл 08 16:32:18 server systemd[1]: Failed to start OpenVPN connection to server.
июл 08 16:32:18 server systemd[1]: Unit openvpn@server.service entered failed state.

покажи содержимое /etc/default/openvpn

Вобще не реагирует

Права на конфиг какие? Дропает ли демон свои привилегии до nobody:nobody ?

# This is the configuration file for /etc/init.d/openvpn
# # Start only these VPNs automatically via init script.
# Allowed values are «all», «none» or space separated list of
# names of the VPNs. If empty, «all» is assumed.
# The VPN name refers to the VPN configutation file name.
# i.e. «home» would be /etc/openvpn/home.conf
#
# If you’re running systemd, changing this variable will
# require running «systemctl daemon-reload» followed by
# a restart of the openvpn service (if you removed entries
# you may have to stop those manually)
#
#AUTOSTART=«all»
#AUTOSTART=«none»
#AUTOSTART=«home office»
#
# WARNING: If you’re running systemd the rest of the
# options in this file are ignored.
#
# Refresh interval (in seconds) of default status files
# located in /var/run/openvpn.$NAME.status
# Defaults to 10, 0 disables status file generation
#
#STATUSREFRESH=10
#STATUSREFRESH=0
# Optional arguments to openvpn’s command line
OPTARGS=«»
#
# If you need openvpn running after sendsigs, i.e.
# to let umountnfs work over the vpn, set OMIT_SENDSIGS
# to 1 and include umountnfs as Required-Stop: in openvpn’s
# init.d script (remember to run insserv after that)
#
OMIT_SENDSIGS=0

/etc/openvpn# ls -l
итого 24
drwxr-xr-x 2 root root 4096 июл 4 05:00 easy-rsa
drwxr-xr-x 2 root root 4096 июл 4 04:56 keys
drwxr-xr-x 2 root root 4096 июл 8 14:40 log
drwxr-xr-x 2 root root 4096 июл 4 05:06 script
-rwxrwxrwx 1 root root 942 июл 8 16:32 server.conf
-rwxr-xr-x 1 root root 1301 ноя 12 2015 update-resolv-conf
С правами все хорошо специально поставил даже 777

Что-то шибко мелкий какой-то конф файл, он там точно не пустой у тебя?

mode server
##protocol port
port 1194
proto tcp
dev tap

##ip server client
server 10.4.0.0 255.255.255.0

##key ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh1024.pem

##option
persist-key
persist-tun
keepalive 5 60
reneg-sec 432000

##option authen.
comp-lzo
user nobody
#group nogroup
client-to-client
username-as-common-name
client-cert-not-required
auth-user-pass-verify /etc/openvpn/script/login.sh via-env

##push to client
max-clients 50
push «persist-key»
push «persist-tun»
push «redirect-gateway def1»
#push «explicit-exit-notify 1»

##DNS-Server
push «dhcp-option DNS 8.8.8.8»
push «dhcp-option DNS 8.8.4.4»

Источник

Оцените статью
toolgir.ru
Adblock
detector