Ubuntu – SSH Lost Terminal Colors

command linegnome-terminalssh

I have to computers with exactly the same configuration (same PS1 etc…).
When I ssh from A to B the terminal correctly displays PS1 and file type colors (i.e. blue directories, green executables etc.)

But when I ssh from B to A PS1 is set to default and colors disappear. Furthermore, I created public keys to ssh without password from A to B and vice-versa. It works correctly from A to B but it doesn't work from B to A, again I repeated the exact same procedure on both pc:

On Host A

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub address.to.host.B

On Host B

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub address.to.host.A

What could be the problem?

EDIT:

The problem is that when I ssh from B to A bash is not called in B. But why?

Best Answer

the remote .bashrc file is not executed by default when connecting over ssh.

Adding source .bashrc to .bash_profile solved the problem. Still I don't know why it keeps asking for the password.

Related Question