Ever had one of those Twilight Zone experiences? You know where something works one minute, but doesn’t the next? It’s like the universe just getting suxed into a black hole?
Okay well my experience wasn’t quite that dramatic, but this took over a year to figure out.
Symptoms
If I was locally connected to a machine, .bash_aliases worked fine. (.bash_aliases are user added aliases to the bash shell). But, if I ssh’d (secure shell) into the machine, it was like, huh? What are you talking about?
I fought this for a year.
Solution
So someone on ubuntu (yofel) said: “Hey, look at your .profile!”
So I did. Here’s what I got:
nwayno@Phoenix:~$ ls -l -t -r .bash*
-rwxr-xr-x 1 nwayno nwayno 925 2007-05-20 00:45 .profile.old
-rw-r–r– 1 nwayno nwayno 675 2011-01-26 23:48 .profile
nwayno@Phoenix:~$ cat .profile.old
# Sample .profile for SuSE Linux
# rewritten by Christian Steinruecken
#
# This file is read each time a login shell is started.
# All other interactive shells will only read .bashrc; this is particularly
# important for language settings, see below.
Uh oh! SuSE .profile, on a Ubuntu machine? Who would have thought? So I renamed the .profile
copied it over from another machine (using scp)
logged out/back in again (to re-read .bashrc)
and TADA! .bash_aliases worked when I ssh’d into the box.
So, the lesson here is, if you change Linux distros, you will probably need to change the .profile file as well.
The weird flakiness is gone!
And so it goes….
Wayno
Related Articles
No user responded in this post