docker-ssh icon indicating copy to clipboard operation
docker-ssh copied to clipboard

How to get ~/.bashrc auto loaded when SSH session start?

Open namgivu opened this issue 8 years ago • 3 comments

I try to put in prmpt color in the bashrc flke but it is not loaded automatically i.e. I have to call source ~/.bashrc manually.

namgivu avatar Jul 08 '17 06:07 namgivu

Also posted on askubuntucom https://askubuntu.com/questions/505506/how-to-get-bash-or-ssh-into-a-running-container-in-background-mode/681159#comment1478293_681159

namgivu avatar Jul 08 '17 06:07 namgivu

Hm I just found the same problem. The default prompt is unhelpful as it omits the hostname, but worse, the hostname may not be set to what you need to correctly identify what the prompt relates to. Even /etc/profile.d/* is seemingly getting skipped. This means that you don't have any automatic visual cue as to what the command prompt belongs to.

I am guessing that bash is being started in such a way that it is bypassing its entire initialisation process. However, if you then type "bash", you'll find that .bashrc gets executed.

Daniel-Beardsmore avatar Sep 05 '18 10:09 Daniel-Beardsmore

Hm I just found the same problem. The default prompt is unhelpful as it omits the hostname, but worse, the hostname may not be set to what you need to correctly identify what the prompt relates to. Even /etc/profile.d/* is seemingly getting skipped. This means that you don't have any automatic visual cue as to what the command prompt belongs to.

I am guessing that bash is being started in such a way that it is bypassing its entire initialisation process. However, if you then type "bash", you'll find that .bashrc gets executed.

It would be useful if the default prompt was "container-name: path # " too.

Daniel-Beardsmore avatar Sep 05 '18 10:09 Daniel-Beardsmore