0

Lets say i have a machine with a few virtual machines on them, how would i forward ssh connections to those virtual machines without giving access to the host machine? Is it possible to do so with only a single port exposed to the outside world? This would also apply to a machine, with some other machines behind it.

I would like to do the redirect based on which keys are used, or perhaps based on a flag set in the ssh command on the client.

1

1 Answer 1

1

You can create user tunel and set his home shell to /bin/true.

This will allow ssh -N -L local_port:ip_of_vm:port_of_vm tunel@your_ip to work but if user try to get shell he will get just gracefull end of shell.

The second thing you should think of is if you can expose vm's to the internet so the second side have full access

2
  • Will this also protect against users trying to scp things to/from the host machine? Apr 11, 2019 at 17:35
  • Yes it prevents it.
    – Aroly7
    Apr 11, 2019 at 17:49

Not the answer you're looking for? Browse other questions tagged .