I need my CI/CD on github actions to log into VPN in order to access ssh on server and deploy stuff. VPN server itself works fine, as I tried to do the same sequence on my linux machine and it worked like a charm. But when I try to do it in automated way, it provides the password and it ends there. It doesn't even ask for standard. It happens both on github actions, as well as when I try to pass the last command from my github action on my linux machine.
There is my yml code:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install softether
run: |
sudo apt-get update
sudo apt-get install build-essential -y
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz
tar xzvf softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz
cd vpnclient
make
- name: Setup connection and connect
run: |
cd vpnclient
sudo ./vpnclient start
(
echo "2"
echo ""
echo "NicCreate myadapter"
echo "AccountCreate ${{ secrets.VPN_USER }}"
echo "${{ secrets.PROD_VPN_ADDRESS }}"
echo "${{ secrets.VPN_HUB }}"
echo "${{ secrets.VPN_USER }}"
echo "myadapter"
echo "AccountPasswordSet myconnection"
echo "${{ secrets.VPN_PASSWORD }}"
echo "${{ secrets.VPN_PASSWORD }}"
echo ""
echo "standard"
echo "AccountConnect ${{ secrets.VPN_USER }}"
) | ./vpncmd
And this is the output in GitHub actions:
By using vpncmd program, the following can be achieved.
1. Management of VPN Server or VPN Bridge
2. Management of VPN Client
3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)
Specify the host name or IP address of the computer that the destination VPN Client is operating on.
If nothing is input and Enter is pressed, connection will be made to localhost (this computer).
Connected to VPN Client "localhost".
NicCreate command - Create New Virtual Network Adapter
The command completed successfully.
AccountCreate command - Create New VPN Connection Setting
The command completed successfully.
AccountPasswordSet command - Set User Authentication Type of VPN Connection Setting to Password Authentication
Please enter the password. To cancel press the Ctrl+D key.
Password: *********
Confirm input: *********
Error: Process completed with exit code 38.
Any help will be appreciated.