I have the computer A (kali linux) where I defined some aliases and functions in the bash_aliases for the user 'test'. I can use these aliases/functions from the computer A without any problem.
With the computer B, I connect to A with SSH command and I try execute aliases/functions I defined. But I get the error "bash: myaliasA: command not found"
Here I see I must add the "shopt -s expand_aliases" command.
I add this in the .bashrc of the computer A (and source .bashrc), but I still get the same error (command not found)
I add this in the .bashrc of the computer B (and source .bashrc), same, I still get "command not found" when I connect with ssh
I don't understand where is the issue :/
In the computer A, when I run the command "shopt" I get :
...
execfail off
expand_aliases on
extdebug off
...
Same in the computer B :
...
execfail off
expand_aliases on
extdebug off
...
From my computer A, I can execute all my alias/functions without any problem.
From my computer B, when I execute this command :
ssh userA@ipofcomputerA -p xxxx "alias"
This command return nothing
But if I execute :
ssh userA@ipofcomputerA -p xxxx "shopt"
I get :
...
execfail off
expand_aliases off
extdebug off
...
The expand_aliases is set to off !
So, I test this :
ssh userA@ipofcomputerA -p xxxx "shopt -s expand_aliases ; shopt ; myaliasA"
and
ssh userA@ipofcomputerA -p xxxx "shopt -s expand_aliases ; shopt ; source .bashrc ; myaliasA"
With this two commands, I get :
...
execfail off
expand_aliases on
extdebug off
...
but I get after "bash: myaliasA: command not found"
I'm going crazy x) haha