SSH not working

I have a basic action setup that first connects to a VPN, and should then SSH to a remote server and run 2 basic commands, pwd and whoami

The VPN seems to be working, confirmed by the hosting provider. However, the SSH part simply doesn’t work, and the hosting provider has stated they found no attempts at SSH authentication on their end.

I tried using an exisitng action, appleboy/ssh-action@master, with my private key, but that timesout. And I tried simply running the ssh command as a run statement, again using my private key.

I’m at a total loss now, having wasted a full day pushing 30+ commits trying to make this work. Someone must have figured out how to connect to a VPN and use SSH with Github Actions?!

If the is no incoming connection attempt on the other side at all, my guess is that there’s a routing issue and the SSH connection attempt doesn’t go through the VPN. That’s hard to verify without a lot more detail about your setup, though. :sweat_smile:

Could the issue be that the VPN connection is separate to the SSH connection call?

Would there maybe be something I need to change with the OpenVPN command or the SSH command to make it route the traffic properly?

So we use Sonassi Magestack. They have port forwarding available, but Github Actions has way too many IPs for them to be configured really. That’s why I have to use the VPN connection.

My host got back to me.

Looks like I was missing a couple of things:

  • I was calling openvpn without sudo
  • I need to call openvpn with a trailing & (I was using --daemon, which may work)
1 Like