我的目标是让这些事情奏效:
我可以让两种情况同时发挥作用,但不能同时发生。
我的/ etc / sshd_config是:
Match Group restricted
ChrootDirectory /home/restricted/users
AllowAgentForwarding no
X11Forwarding no
AllowTcpForwarding yes
ForceCommand internal-sftp
显然这是sftp的工作案例。使用此配置,无法打开远程端口进行端口转发。
目前允许tcp转发的唯一方法是禁用 ForceCommand 和 ChrootDirectory 指令。
另外,我必须将shell更改为/ bin / bash以允许端口转发。
我的梦想情况是:
这甚至可能吗?如果是这样,我需要做什么?
提前致谢。
答案 0 :(得分:2)
感谢 Charles Duffy ,我知道我做错了什么。上面的配置确实确实有效,但是,我必须在我的ssh客户端请求中添加“-N”:
ssh -N -R remote_port:localhost:port user@host
这也适用于shell设置为/ bin / false
很抱歉选择了错误的部分,我下次会尝试使用unix.stackexchange。
再次感谢!