Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
added 173 characters in body
Source Link

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port or this Google search. This, in addition to ControlMaster auto, should not require any additional passwords (either local or remote).

However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port. This, in addition to ControlMaster auto, should not require any additional passwords (either local or remote).

However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port or this Google search. This, in addition to ControlMaster auto, should not require any additional passwords (either local or remote).

However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.

added 203 characters in body
Source Link

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port. This, in addition to ControlMaster auto, should not require any additional passwords (either local or remote).

However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port. However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port. This, in addition to ControlMaster auto, should not require any additional passwords (either local or remote).

However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.

Source Link

You could always reroute (forward) localhost:2222 localhost:22 using iptables, eg.

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j REDIRECT --to-port 22

See alias port / port forwarding to another local port. However to me this seems unnecessary and makes me wonder if you don't have a case of the XY problem.