Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 7 down vote accepted

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.

share|improve this answer
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 '11 at 15:30

You must log in to answer this question.

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