SSH 隧道、端口转发设置

SSH 隧道、端口转发设置

我有一个用于 SSH 隧道的简单 bash 脚本

createTunnel() {
  /usr/bin/ssh -i /home/miner/EC2.pem -f -N -R 10022:localhost:22 -L 19922:[email protected]:22 [email protected]
  if [[ $? -eq 0 ]]; then
    echo Tunnel created successfully
  else
    echo An error occurred
  fi
}
/usr/bin/ssh -p 19922 localhost ls > /dev/null
if [[ $? -ne 0 ]]; then
  echo Creating new tunnel
  createTunnel
fi

当我运行它时,出现以下错误,可能的原因是什么?

channel_setup_fwd_listener: cannot listen to port: 10022
channel_setup_fwd_listener_tcpip: cannot listen to port: 19922
channel 2: open failed: administratively prohibited: open failed
channel 3: open failed: administratively prohibited: open failed

相关内容