I have an infrastructure that mostly consists of Ubuntu machines and many users. We like to use X2GO for remote access, which works well. We now have an AlmaLinux 8.8 machine. When login onto that one with X2GO and opening a terminal, the prompt is messed up and only writes something like bash-4.4$
.
We figured out that this is because opening a terminal in X2GO is not a login shell (sorry, not so sure anymore, see edit) and thus the . The Ubuntu system is somehow configured to work without a local /etc/bashrc
is not sourced by the /etc/profile
.bashrc
in the user's home directory.
Thus, all home dirs are created without a .bashrc
.
I want to fix that on the AlmaLinux machine by always sourcing the /etc/bashrc
. This is because I do not have access to the mechanism that creates new homes for new users, and I do not want to create/tell all users to have a local .bashrc
. Is there a way to realize that? I do have sudo rights on the Alma machine.
[Edit]
After checking again, I noticed this block in the /etc/profile
:
if [ -n "${BASH_VERSION-}" ] ; then
if [ -f /etc/bashrc ] ; then
# Bash login shells run only /etc/profile
# Bash non-login shells run only /etc/bashrc
# Check for double sourcing is done in /etc/bashrc.
. /etc/bashrc
fi
fi
/etc/profile
on the relevant machines? If you can just add. /etc/bashrc
as an additional line in/etc/profile
. But why not just add what you need from/etc/bashrc
to/etc/profile
?/etc/profile
is loaded. He specifically asks: "I would like to fix that on the AlmaLinux machine by always sourcing the /etc/bashrc.". Am I missing something?/etc/profile
? That requires root access. If you have root access, you also have write access to/etc/skel/
so you can set up new users with.bashrc
if you want to.