As far as i know upon SSH login the following files are executed
[SERVER] /etc/environment
[Client] ~/.ssh/environment
-> can be locally overriden by "SSH_ENV" environment variable
-> will override Host=>SendEnv in local ~/.ssh/config
-> will be filtered by "AcceptEnv" directive(s) in remote /etc/ssh/sshd_config
-> will NOT be used if "PermitUserEnvironment no" in remote /etc/ssh/sshd_config
[SERVER] /etc/ssh/sshrc
-> will NOT get executed if "ForceCommand" exists in remote /etc/ssh/sshd_config
-> will NOT get executed if local ~/.ssh/rc exists
-> can be overriden by "ForceCommand" (kind of)
[Client] ~/.ssh/rc
-> will NOT get executed if "ForceCommand" is configured
-> can be overriden by local "???" environment variable?
Question
How can i force the execution of a script on the server but still allow the client to use his ~/.ssh/rc
?
Bonus question
Is it possible to override the local ~/.ssh/rc
location using an environment variable? If yes which one?
~/.ssh/rc
from inside a remotely executed command, can i ?