
Isso funciona bem, mas não carrega ~/.bash_profile
no servidor2. Por que?
$ ssh -A -t server1 ssh -A -t server2 bash -c "screen -dR"
Responder1
Da bash
man
página:
When an interactive shell that is not a login shell is started, bash
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
these files exist. This may be inhibited by using the --norc option.
The --rcfile file option will force bash to read and execute commands
from file instead of /etc/bash.bashrc and ~/.bashrc.
Você pode reconectar-se a uma sessão existente em execução screen
(talvez com uma sessão já em execução bash
), o que não requer um shell de login. Ou você cria uma nova screen
sessão com um novo shell interativo sem login. Somente processos de shells de login .bash_profile
.
O que bash
você especifica na linha de comando que inicia o screen
comando é uma invocação completamente diferente.