Is it possible to connect to Linux VPS via VPN running on another Linux VPS at all? I have 2 Debian VPS boxes. The first one runs openvpn only. The second one is production. I entered the IP address of the one that runs openvpn into the second one iptables' rules, allowing it to connect -A INPUT -s 1.1.1.1/32 -p tcp -m tcp --dport 22 -j ACCEPT. However, it always times out and won't connect. For testing purposes I flushed all the iptable rules but it still won't connect. The box that runs openvpn is working fine. The second production box is also working fine. Now how do I connect my running openvpn box to my production box via SSH? I can also connect from my machine at home to both boxes OK. I thought that all that my production box needed was to allow the IP address through iptables but... it appears to be not the case. Would highly appreciate any pointers / suggestions / help at all. Many thanks in advance.
# Generated by iptables-save v1.8.2 on Mon Jul 19 11:23:12 2021
*nat
:PREROUTING ACCEPT [109935:17664249]
:INPUT ACCEPT [3374:238825]
:OUTPUT ACCEPT [256:14081]
:POSTROUTING ACCEPT [256:14081]
COMMIT
# Completed on Mon Jul 19 11:23:12 2021
# Generated by iptables-save v1.8.2 on Mon Jul 19 11:23:12 2021
*mangle
:OUTPUT ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:MARK - [0:0]
:FORWARD ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
COMMIT
# Completed on Mon Jul 19 11:23:12 2021
# Generated by iptables-save v1.8.2 on Mon Jul 19 11:23:12 2021
*filter
:INPUT ACCEPT [515175:66884905]
:FORWARD ACCEPT [1015130:1311622928]
:OUTPUT ACCEPT [1014840:1315160290]
-A INPUT -s 1.1.1.1/32 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j DROP
COMMIT
# Completed on Mon Jul 19 11:23:12 2021
Let me answer my own question. Not sure why it works this way but it works. I simply allowed "password logins" and it all started working perfectly well. It connects using ssh keys anyway without any password prompts but.. nonetheless allowing password logins in ssh solved the issue (I had it turned off earlier). Hope it will help someone too.