ssh - 在 SSH 配置中为特定主机取消设置参数

标签 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]

Host git.[domain]
   ClearAllForwardings yes

git 不会像 scp 和 sftp 那样自动设置 ClearAllForwardings=yes 吗?

关于ssh - 在 SSH 配置中为特定主机取消设置参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9035387/

相关文章:

git - 获取 Visual Studio 2017 以使用 ssh-agent/ssh-add for git

powershell - 来自 Windows 的 SSH 隧道作为后台进程?

linux - 我使用什么命令来查看我的服务器的 ECDSA key 指纹是什么?

linux - 从 bash 脚本添加 ssh 并自动输入密码

linux - 使用 SSH 时 Xming Display 非常慢

java - 使用 SSHTool 将 Putty 私钥转换为 OpenSSH 私钥

python - 使用 python paramiko 时如何过滤 ssh 横幅

ubuntu - 没有用于本地开发的 auth 登录 ssh

java - 从 JSch 中的命令输出中删除 shell 内容(如提示)

ssh - 身份验证错误,隧道管理器中捕获未处理的异常 - 通过 SSH 使用 Mysql Workbench 连接到 digital ocean ubuntu 服务器