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.

Malabarba
  • 8,578
  • 21
  • 69
  • 105

1 Answers1

7

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.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
Jonathan Callen
  • 204
  • 1
  • 6
  • Yep that was it. I have no idea why the two machines had different `.bash_profile`s, but that's what was causing it. – Malabarba Sep 27 '11 at 15:30