New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Question about NAT VPS and SSH tunneling
sidewinder
Member
in Help
RE:SSH tunneling
I'm sure this is a dumb question, but with regular VPS,
ssh -D 5151 [email protected]
to set up a SSH tunnel.
Is this doable with NAT?
Thanked by 1creep
Comments
yes
Yes it is, except you need -p argument as well.
For instance ssh -Dp 12345 user@remote-ip. the -p is the port number ssh is listening on. You will need to change this in /etc/ssh/ssh_config using the console and an editor.
"-D" isn't for SOCKS proxy?
If you want to use your VPS as a VPN through SSH, you can give a look at sshuttle:
https://github.com/sshuttle/sshuttle
Yes you can use SOCKS, ssh port forwarding, or set up a tcp through ssh tunnel, but the last in particular is a hacky substitute for a normal vpn. The current trendy thing is wireguard, I believe.
Yeah it is wireguard, I am not sure why since my openvpn works fine. I am always behind it seems and that's why I stay in my cave.
It's faster and has a more sane setup. Also handles connection drops far better.
Never had a problem with any of that. So I guess I am lucky.
Unless it's not stuck in openvz. I never heard KVM NAT VPS for a while. Or is it changed in OpenVZ 7?
awesome - this is needed bc the NAT VPS is always going to have ssh on a non-standard port?
Yes, you can also put the port number in your .ssh/config file so you don't have to put it on the command line.
Yeah you can, but make sure that you do it for only the nat vps and not globally. That will give you a head ache if you forget that you did it and can't ssh to any other box.