P
P
pcdesign2021-08-13 10:56:58
linux
pcdesign, 2021-08-13 10:56:58

How to allow port forward only to a specific network or to a specific port?

The user connects via ssh.
How to allow it to port forward only to certain networks?
For example, so that he could do this:

ssh  [email protected] -L localhost:2222:192.168.10.2:22


But I couldn't do it like this:
ssh [email protected] -L localhost:2222:mail.ru:80

We are talking about old centos 6.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2021-08-13
@Lynn

https://linux.die.net/man/5/sshd_config setting PermitOpen
But this is anyway protection from honest people.
Perhaps it would be better to set up a firewall on a remote machine if there should be no access from it at all ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question