Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用~/.ssh/config文件来设置我的 ssh 选项。
~/.ssh/config
我想为同一主机指定 scp 和 ssh 的不同设置。有可能做到吗?
我浏览了文档,但无法做到这一点。
我会制作第二个配置文件,~/.ssh/scp_config然后使用 shell 别名scp来-F指定配置文件:
~/.ssh/scp_config
scp
-F
alias scp="scp -F ~/.ssh/scp_config`
(这是一个未经测试的zsh别名;我不知道 Bash 别名有多么不同,但想法应该是相似的。另请注意,这可能仍需要您scp -F <file>在脚本中使用)。
zsh
scp -F <file>