Question

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.

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top