Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.bash_profile not read over parallel ssh connection #3

Open
mrkafk opened this issue Oct 22, 2018 · 1 comment
Open

.bash_profile not read over parallel ssh connection #3

mrkafk opened this issue Oct 22, 2018 · 1 comment

Comments

@mrkafk
Copy link

mrkafk commented Oct 22, 2018

I'm using hss to connect to 3 Ubuntu servers (the same edition). The problem is on 2 of them ~/.bash_profile is not read over hss, even though it is being read when I ssh in individually to each.

$ env | grep -w PATH
[O] root@example-sql -> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
[O] root@example-www -> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
[O] root@example-search -> PATH=.:/root/bin:/usr/local/node/bin:...

example-search does read .bash_profile apparently, because there are additional directories that I added to PATH, like /root/bin, etc. The first two, however, do not seem to.

Why is that happening? How can I fix that (I want PATH the way I defined it, obviously).

I'm getting the same effect on another group (Debian 8 servers).

@boussou
Copy link

boussou commented Aug 26, 2020

it is ssh matter

A login shell first reads /etc/profile and then ~/.bash_profile.

A non-login shell reads from /etc/bash.bashrc and then ~/.bashrc.

see ssh - Why does remote Bash source .bash_profile instead of .bashrc - Unix & Linux Stack Exchange
https://unix.stackexchange.com/questions/332531/why-does-remote-bash-source-bash-profile-instead-of-bashrc

bash - Why is SSH not invoking .bash_profile? - Super User
https://superuser.com/questions/952084/why-is-ssh-not-invoking-bash-profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants