I am using ~/.ssh/config file to set my ssh options.

I want to specify different settings for scp and ssh to the same host. Is it possible to do it?

I went through the documentation, but couldn't a way to do it.

有帮助吗?

解决方案

I'd make a second config file, ~/.ssh/scp_config, and then use a shell alias for scp with the -F option to specify the config file:

alias scp="scp -F ~/.ssh/scp_config`

(This is an untested zsh alias; I don't know how different Bash alias' are, but the idea should be similar. Note also that this may still require you to use scp -F <file> in scripts).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top