在SSH配置中取消设置特定主机的参数
在在SSH配置中取消设置特定主机的参数,ssh,openssh,Ssh,Openssh,在.ssh/config中,我为给定域中的所有主机设置了一个RemoteForward: Host *.[domain] RemoteForward [remote-port] 127.0.0.1:[local-port] 如何为该域中的特定主机(例如,git.[domain])取消设置该参数?尝试ClearAllForwardings设置: Host *.[domain] RemoteForward [remote-port] 127.0.0.1:[local-port] Ho
.ssh/config
中,我为给定域中的所有主机设置了一个RemoteForward
:
Host *.[domain]
RemoteForward [remote-port] 127.0.0.1:[local-port]
如何为该域中的特定主机(例如,
git.[domain]
)取消设置该参数?尝试ClearAllForwardings设置:
Host *.[domain]
RemoteForward [remote-port] 127.0.0.1:[local-port]
Host git.[domain]
ClearAllForwardings yes
git没有像scp和sftp那样自动设置ClearAllForwardings=yes吗?主页面提到使用否定排除某些主机,但仅用于
.ssh/authorized\u keys
中的密钥。我在.ssh/config
中尝试过类似的组合,但在我期望的主机主页中没有任何类似的组合!git.[domain],*[domain]
来做你想做的事。你试过什么组合?似乎没有。我在~/.ssh/config
上设置了RemoteForward 52698 127.0.0.1:52698
,以便在所有域上使用,但随后开始得到警告:连接到GitHub时侦听端口52698
的远程端口转发失败(因为它显然不允许转发端口)。使用主机github.com下的ClearAllForwardings=yes
,错误消失了。