Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在SSH配置中取消设置特定主机的参数_Ssh_Openssh - Fatal编程技术网

在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
,错误消失了。