I've some rules in .ssh/config file which I would like activate only in interactive mode (ie. terminal background change). Is that possible?
1 Answer
You can alias ssh
if using a non-interactive shell as follows in your ~/.bashrc
file:
if [ -z "$PS1" ]; then
alias ssh='ssh -F ~/.ssh/config-non-interactive'
fi
... then copy the non-interactive configuration you'd like to use to ~/.ssh/config-non-interactive
and you should be set.
-
When this is combined with
Include
I think it will be a flexible way of utilising config files. superuser.com/a/1142813 . There were many times I gave up on certain config features because it wasn’t compatible across my workstations.– user311189Sep 20, 2018 at 14:19
ssh
command or not? Or are you referring to the use of any of the flags-t
,-T
,-N
?