Я сконфигурировал сервер бастионов на AWS в моей публичной подсети. Я могу сделать прямой ssh экземпляру ec2 внутри частной подсети, используя хост bastion.Пытается создать SSH-тюнер
Я могу подключиться к бастионному хосту и проверить, открыт ли порт 7474 на закрытом экране ec2.
nc -v -z -w 5 10.0.3.102 7474; echo $?
Connection to 10.0.3.102 7474 port [tcp/*] succeeded!
0
Я хочу SSH туннель с локального хоста (мой домашний компьютер) к экземпляру ec2 в частной сети.
ssh -v -C -N -L 9000:PRIVATE_MDM:7474 BASTION
Но я получаю:
Не удалось открыть: запрещен администратором: открыт ошибка
Authenticated to 52.32.240.40 ([52.32.240.40]:22).
debug1: Local connections to LOCALHOST:9000 forwarded to remote address PRIVATE_MDM:7474
debug1: Local forwarding listening on ::1 port 9000.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 9000.
debug1: channel 1: new [port listener]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Connection to port 9000 forwarding to PRIVATE_MDM port 7474 requested.
debug1: channel 2: new [direct-tcpip]
debug1: Connection to port 9000 forwarding to PRIVATE_MDM port 7474 requested.
debug1: channel 3: new [direct-tcpip]
channel 2: open failed: administratively prohibited: open failed
channel 3: open failed: administratively prohibited: open failed
debug1: channel 2: free: direct-tcpip: listening port 9000 for PRIVATE_MDM port 7474, connect from 127.0.0.1 port 42685 to 127.0.0.1 port 9000, nchannels 4
debug1: channel 3: free: direct-tcpip: listening port 9000 for PRIVATE_MDM port 7474, connect from 127.0.0.1 port 42686 to 127.0.0.1 port 9000, nchannels 3
debug1: Connection to port 9000 forwarding to PRIVATE_MDM port 7474 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: administratively prohibited: open failed
debug1: channel 2: free: direct-tcpip: listening port 9000 for PRIVATE_MDM port 7474, connect from 127.0.0.1 port 42687 to 127.0.0.1 port 9000, nchannels 3
Если это не поможет, попробуйте найти причины в журнале сервера или попробуйте запустить сервер в режиме отладки. Он должен рассказать вам более точные причины. – Jakuje
см. Мой отредактированный ответ. – Jakuje