端口转发命令

Port forwarding command

我正在尝试使用以下命令通过 ssh 进行端口转发:

ssh -L  9540:localhost:8011 user@ipdest

端口用于 https 流量,当我 运行 命令时我没有收到任何类型的错误,实际上我得到了到目标 ip 的 ssh 连接。

问题是,当我尝试将浏览器连接到 url localhost:9540 时,它没有显示任何内容,我无法访问 https 服务。

能否请您使用以下命令检查 sshd 配置文件并确保粗体行与示例相同?

more  /etc/ssh/sshd_config

#AllowAgentForwarding 是

AllowTcpForwarding 是

#GatewayPorts 否

X11转发是

#X11DisplayOffset 10

#X11UseLocalhost 是

#PermitTTY 是

打印模式没有

#PrintLastLog 是

#TCPKeepAlive 是

#PermitUserEnvironment 否

#压缩延迟

#ClientAliveInterval 0

#ClientAliveCountMax 3

#UseDNS 否

#PidFile /var/run/sshd.pid

#MaxStartups 10:30:100

允许隧道是

#ChrootDirectory none

#版本附录none

如果不是,请将线路设置为示例并重新启动 sshd 服务,尝试重新连接并再次测试您的隧道。