据我所知,SSH 登录后将执行以下文件
[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?
问题
我如何强制在服务器上执行脚本但仍允许客户端使用他的脚本~/.ssh/rc
?
附加问题
是否可以~/.ssh/rc
使用环境变量覆盖本地位置?如果可以,覆盖哪一个?