根用户的 SSH 远程转发失败

根用户的 SSH 远程转发失败

rmate我在我的(本地)文件中使用以下配置为 Sublime () 进行远程转发.ssh/config

Host host
User user
Hostname hostname
RemoteForward /home/user/.rmate.socket localhost:52698

这对于非 root 用户也能成功运行:

debug1: Remote connections from /home/user/.rmate.socket:-2 forwarded to local address localhost:52698
...
debug1: remote forward success for: listen /home/user/.rmate.socket:-2, connect localhost:52698
debug1: All remote forwarding requests processed

但是,当我尝试将其更改为 时User root,它不再起作用,即使我将其更改RemoteForward/root/.rmate.socket,,/tmp/.rmate.socketETC。

debug1: Remote connections from /root/.rmate.socket:-2 forwarded to local address localhost:52698
...
debug1: Remote: Server has disabled port forwarding.
debug1: remote forward failure for: listen /root/.rmate.socket:-2, connect localhost:52698
Warning: remote port forwarding failed for listen path /root/.rmate.socket
debug1: All remote forwarding requests processed

root但是,当使用远程端口而不是套接字文件时,这有效:

debug1: Remote connections from LOCALHOST:52698 forwarded to local address localhost:52698
...
debug1: remote forward success for: listen 52698, connect localhost:52698
debug1: All remote forwarding requests processed

这是用户的默认行为吗?我也root可以让它工作吗?root

相关内容