5

I have two Linux computers at work, a desktop and a laptop, running Openssh under Arch Linux. Under my standard logins, I have a customized .bashrc file inside my home folder on both computers.

Here's the question: When I ssh to the desktop, I'm presented with a pretty customized bash (meaning the .bashrc file has been read). When I ssh to the laptop, I'm presented with a plain and gray bash, and I have to manually run exec bash (so it will read my custom .bashrc). Why?

I must have configured something different on one of these computers that's causing the difference, but I can't figure out what. The ssh command I'm running is a simple ssh username@host (with a clean .ssh/config file) in both cases.

Note: There is already a question asking how to use your .bashrc over ssh, I'm not asking that. I just want to know why one of the hosts is using it, but the other isn't.

1 Answer 1

8

Does the .bash_profile (or .profile if .bash_profile does not exist) run . .bashrc or source .bashrc at some point? If not, then your .bashrc will not be used when logging in via ssh, as ssh always starts bash as a "login" shell, which never reads .bashrc by default.

1
  • Yep that was it. I have no idea why the two machines had different .bash_profiles, but that's what was causing it.
    – Malabarba
    Sep 27, 2011 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .