如何在. .ssh/config中提供其他选项?我知道,可以在ssh -配置文件中使用主机、端口、用户等信息来缩写ssh命令。我经常使用选项"-Nf“创建ssh隧道,以分叉到后台。是否也可以在配置文件中提供这样的选项,以及如何提供?
发布于 2014-01-23 10:32:57
我经常对LocalForward
指令做同样的事情。我还使用ControlMaster
、ControlPersist
和ControlPath
指令进行连接修改;如果我想拥有一个仅用于隧道的连接,因为我的连接的muxer持续30分钟,我可以使用ssh user@hostname.example.com logout
并有30分钟来打开任何隧道连接,而隧道将一直打开,直到我30分钟没有使用它们为止。
下面是我的~/.ssh/config
的相关部分:
ControlMaster auto
ControlPath ~/.ssh/mux/ssh_mux_%h_%p_%r
ControlPersist 30m
host shortname
User username
HostName remotehost.example.com
LocalForward localhost:1234 192.168.6.76:1234
https://unix.stackexchange.com/questions/110630
复制相似问题