So i'm trying to write a script to ease the process of connecting to OpenVPN server.
So when i write:
openvpn --config vpnbook-pl226-udp53.ovpn
It prompts me to type username and password:
Wed Apr 1 21:23:28 2020 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019Wed Apr 1 21:23:28 2020 library versions: OpenSSL 1.1.1d 10 Sep 2019, LZO 2.10Enter Auth Username: Enter Auth Password:
Here i want my script to automatically send username and password to OpenVPN.
I had the following attempts:
Attempt 1:
{ echo "vpnbook"; echo "3vze4vd"; } | openvpn --config vpnbook-pl226-udp53.ovpn
Attempt 2:
echo -e "vpnbook\n3vze4vd" | openvpn --config vpnbook-pl226-udp53.ovpn
Attempt 3:
(echo $username; echo $password;) | openvpn --config vpnbook-pl226-udp53.ovpn
But none of them are working, i'm getting the following output:
Wed Apr 1 21:38:14 2020 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019Wed Apr 1 21:38:14 2020 library versions: OpenSSL 1.1.1d 10 Sep 2019, LZO 2.10
Then nothing happens.
Can someone please give me a hint on this ?