hwdsl2 / openvpn-install

OpenVPN server installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS, Fedora, openSUSE, Amazon Linux 2 and Raspberry Pi OS
MIT License
1.02k stars 319 forks source link

sed: can't read /etc/openvpn/server/tc.key: No such file or directory #42

Closed sec13b closed 4 months ago

sec13b commented 4 months ago
sudo bash openvpn.sh --auto

OpenVPN Script
https://github.com/hwdsl2/openvpn-install

Starting OpenVPN setup using default options.

Server IP: .....
Port: UDP/1194
Client name: client
Client DNS: Google Public DNS

Installing OpenVPN, please wait...
+ yum -y -q install epel-release
+ yum -y -q install openvpn openssl ca-certificates tar
+ ./easyrsa --batch init-pki
+ ./easyrsa --batch build-ca nopass
+ ./easyrsa --batch --days=3650 build-server-full server nopass
+ ./easyrsa --batch --days=3650 build-client-full client nopass
+ ./easyrsa --batch --days=3650 gen-crl
+ openvpn --genkey --secret /etc/openvpn/server/tc.key
openvpn.sh: line 675: openvpn: command not found
+ systemctl enable --now openvpn-server@server.service
sed: can't read /etc/openvpn/server/tc.key: No such file or directory

Finished!

The client configuration is available in: /root/client.ovpn
New clients can be added by running this script again.
[root@dns3 ~]# ls -at /etc/openvpn/server/
.  client-common.txt  dh.pem  server.conf  ca.crt  ca.key  crl.pem  server.crt  server.key  easy-rsa  ..
[root@dns3 ~]#
hwdsl2 commented 4 months ago

@sec13b Hello! This may be a temporary issue with your server's package repositories, resulting in the openvpn package failing to install on your system. You can check if it can be installed using:

yum install openvpn

Running the script again can usually fix the problem. If it says OpenVPN is already installed, remove it and try again.

sec13b commented 4 months ago
[root@123~]# sudo bash openvpn.sh --auto

OpenVPN Script
https://github.com/hwdsl2/openvpn-install

Starting OpenVPN setup using default options.

Server IP: .....
Port: UDP/1194
Client name: client
Client DNS: Google Public DNS

Installing OpenVPN, please wait...
+ yum -y -q install epel-release
+ yum -y -q install openvpn openssl ca-certificates tar
+ ./easyrsa --batch init-pki
+ ./easyrsa --batch build-ca nopass
+ ./easyrsa --batch --days=3650 build-server-full server nopass
+ ./easyrsa --batch --days=3650 build-client-full client nopass
+ ./easyrsa --batch --days=3650 gen-crl
+ openvpn --genkey --secret /etc/openvpn/server/tc.key
openvpn.sh: line 675: openvpn: command not found
+ systemctl enable --now openvpn-server@server.service
sed: can't read /etc/openvpn/server/tc.key: No such file or directory

Finished!

The client configuration is available in: /root/client.ovpn
New clients can be added by running this script again.
[root@123~]# yum install openvpn
No package openvpn available.
Error: Nothing to do
[root@123~]#