在我可以连接到特定的远程机器之前,我必须运行某个本地命令。所以,而不是ssh me@remote.machine我必须做
local_command
ssh me@remote.machine
Run Code Online (Sandbox Code Playgroud)
我想自动执行此操作,以便我只需要执行ssh remote.machine.
我知道我可以通过创建自己的ssh调用脚本在 shell 级别实现这一点/usr/bin/ssh,但是我可以使用 的ProxyCommand选项来实现ssh_config吗?
据我了解,我需要类似的东西
Host remote.machine
ProxyCommand local_command; ssh me@remote.machine
Run Code Online (Sandbox Code Playgroud)
在我的~/.ssh/config文件中,但当然不完全是这样,因为它是圆形的!