Nyr / openvpn-install

OpenVPN road warrior installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora
MIT License
19.24k stars 4.91k forks source link

For centos install openvpn first #338

Closed Saruwatari34 closed 7 years ago

Saruwatari34 commented 7 years ago

i try install in cents os 7 need to install openvpn before

need to

if else

Else, the distro is CentOS

            yum install epel-release -y
            yum install iptables openssl wget ca-certificates -y
            yum install openvpn -y

    fi
cerebrux commented 7 years ago

Use this https://github.com/Angristan/OpenVPN-install

Nyr commented 7 years ago

I'm not sure what you're trying to say, but the installer is working fine on CentOS 7.

@cerebrux next time that you spam with unhelpful things unrelated to the issue, you'll be banned from this tracker.

Saruwatari34 commented 7 years ago

@Nyr in my vps server is use CentOS7 trying to install openvpn with your code. yum install openvpn iptables openssl wget ca-certificates -y it not work for me. it error not know openvpn i change code to yum install epel-release -y yum install iptables openssl wget ca-certificates -y yum install openvpn -y

it fine.

Nyr commented 7 years ago

I see, but it doesn't make much sense. It is very strange and I can't think of anything which could cause this behaviour, other than an issue with your mirrors.

Could you paste the terminal output of when the issue happens, so I can get a better idea? Still, I insist that the most logical explanation would be a problematic mirror (so not a problem which needs to be fixed in the script).

Saruwatari34 commented 7 years ago

not problem this output.

Welcome to this quick OpenVPN "road warrior" installer

I need to ask you a few questions before starting the setup
You can leave the default options and just press enter if you are ok with them

First I need to know the IPv4 address of the network interface you want OpenVPN
listening to.
IP address: xxx.xxx.xxx.xxx (my server ip)

Which protocol do you want for OpenVPN connections?
   1) UDP (recommended)
   2) TCP
Protocol [1-2]: 1

What port do you want OpenVPN listening to?
Port: xxxx (my port)

Which DNS do you want to use with the VPN?
   1) Current system resolvers
   2) Google
   3) OpenDNS
   4) NTT
   5) Hurricane Electric
   6) Verisign
DNS [1-6]: 2

Finally, tell me your name for the client certificate
Please, use one word only, no special characters
Client name: client

Okay, that was all I needed. We are ready to setup your OpenVPN server now
Press any key to continue...
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.thzhost.com
 * epel: mirrors.thzhost.com
 * extras: mirrors.thzhost.com
 * updates: mirrors.thzhost.com
Package epel-release-7-10.noarch already installed and latest version
Nothing to do
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.thzhost.com
 * epel: mirrors.thzhost.com
 * extras: mirrors.thzhost.com
 * updates: mirrors.thzhost.com
Package 1:openssl-1.0.1e-60.el7_3.1.x86_64 already installed and latest version
Package wget-1.14-13.el7.x86_64 already installed and latest version
Package ca-certificates-2017.2.14-70.1.el7_3.noarch already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package iptables.x86_64 0:1.4.21-16.el7 will be updated
---> Package iptables.x86_64 0:1.4.21-17.el7 will be an update
---> Package openvpn.x86_64 0:2.4.3-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
 Package              Arch               Version                   Repository        Size
==========================================================================================
Installing:
 openvpn              x86_64             2.4.3-1.el7               epel             470 k
Updating:
 iptables             x86_64             1.4.21-17.el7             base             426 k

Transaction Summary
==========================================================================================
Install  1 Package
Upgrade  1 Package

Total size: 896 k
Total download size: 470 k
Downloading packages:
openvpn-2.4.3-1.el7.x86_64.rpm                                     | 470 kB  00:00:00
Running transaction check
Running transaction test

Transaction check error:
  package iptables-1.4.21-17.el7.x86_64 is already installed

Error Summary
-------------

--2017-07-27 09:41:57--  https://github.com/OpenVPN/easy-rsa/releases/download/3.0.1/EasyR                            SA-3.0.1.tgz
Resolving github.com (github.com)... 192.30.255.113, 192.30.255.112
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/4519663/9dab10e8                            -7b6a-11e5-91af-0660987e9192?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX                            4CSVEH53A%2F20170727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170727T024418Z&X-Amz-Exp                            ires=300&X-Amz-Signature=afb81b5b39ececbe45dcca7a67eaa3cb76dffda13709b8ebdd22f660f3e4d825&                            X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%                            3DEasyRSA-3.0.1.tgz&response-content-type=application%2Foctet-stream [following]
--2017-07-27 09:41:58--  https://github-production-release-asset-2e65be.s3.amazonaws.com/4                            519663/9dab10e8-7b6a-11e5-91af-0660987e9192?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credent                            ial=AKIAIWNJYAX4CSVEH53A%2F20170727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170727T02                            4418Z&X-Amz-Expires=300&X-Amz-Signature=afb81b5b39ececbe45dcca7a67eaa3cb76dffda13709b8ebdd                            22f660f3e4d825&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment                            %3B%20filename%3DEasyRSA-3.0.1.tgz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-relea                            se-asset-2e65be.s3.amazonaws.com)... 52.216.225.128
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-r                            elease-asset-2e65be.s3.amazonaws.com)|52.216.225.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40960 (40K) [application/octet-stream]
Saving to: ‘/root/EasyRSA-3.0.1.tgz’

100%[================================================>] 40,960      31.4KB/s   in 1.3s

2017-07-27 09:42:01 (31.4 KB/s) - ‘/root/EasyRSA-3.0.1.tgz’ saved [40960/40960]

mv: cannot stat ‘/etc/openvpn/EasyRSA-3.0.1/’: No such file or directory
chown: cannot access ‘/etc/openvpn/easy-rsa/’: No such file or directory
./openvpn-install.sh: line 243: cd: /etc/openvpn/easy-rsa/: No such file or directory
./openvpn-install.sh: line 245: ./easyrsa: No such file or directory
./openvpn-install.sh: line 246: ./easyrsa: No such file or directory
./openvpn-install.sh: line 247: ./easyrsa: No such file or directory
./openvpn-install.sh: line 248: ./easyrsa: No such file or directory
./openvpn-install.sh: line 249: ./easyrsa: No such file or directory
./openvpn-install.sh: line 250: ./easyrsa: No such file or directory
cp: cannot stat ‘pki/ca.crt’: No such file or directory
cp: cannot stat ‘pki/private/ca.key’: No such file or directory
cp: cannot stat ‘pki/dh.pem’: No such file or directory
cp: cannot stat ‘pki/issued/server.crt’: No such file or directory
cp: cannot stat ‘pki/private/server.key’: No such file or directory
cp: cannot stat ‘pki/crl.pem’: No such file or directory
chown: cannot access ‘/etc/openvpn/crl.pem’: No such file or directory
./openvpn-install.sh: line 256: openvpn: command not found
492
Failed to restart openvpn@server.service: Unit not found.
Failed to execute operation: No such file or directory
cat: /etc/openvpn/easy-rsa/pki/ca.crt: No such file or directory
cat: /etc/openvpn/easy-rsa/pki/issued/client.crt: No such file or directory
cat: /etc/openvpn/easy-rsa/pki/private/client.key: No such file or directory
cat: /etc/openvpn/ta.key: No such file or directory

Finished!

Your client configuration is available at /root/client.ovpn
If you want to add more clients, you simply need to run this script again!
Nyr commented 7 years ago

Your issue is with the iptables package, yum stops after that error and doesn't proceed to install openvpn.

Some kind of conflict is happening in your system with the iptables package and your workaround is just ignoring the original problem, the script is fine and doesn't need this change.

cerebrux commented 7 years ago

@Nyr Sorry if my intentions were misunderstood. I was not aware of "the" situation. And I apologise for that. I'll try to provide more constructive discussion, if needed the next time.