Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 6 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. –  Bruce Connor Sep 27 '11 at 15:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.