0

When I connect to my Ubuntu system remotely, .bashrc is not getting loaded. I know this because lines at the end of .bashrc simply do not run, though they do if I manually dotsource after logging in with . .bashrc. I looked in /etc/skel and checked .profile etc, and I also see the loader lines for .bashrc in the users /home/myuser/.profile. Here are the lines in /home/myuser/.profile (and I am logging into the system with myuser from Putty.exe from a remote Windows host). Why does .bashrc not load as when I log into the system from Putty, /home/myuser/.profile should be loading right?

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi
YorSubs
  • 343

1 Answers1

-1

Ubuntu doesn't run .bashrc. With Ubuntu, gnome-terminal does not normally run as a login shell, so .bashrc should be run directly.

For login shells (like the virtual terminals), normally the file ~/.profile is run, unless you have either ~/.bash_profile or ~/.bash_login, but they are not there by default. By default, Ubuntu uses only .profile.