I am running RHEL 7.3, however the procedure may be similar on other Linux systems.
I have logged in as root. I have a file called openrc
which is full of lines like export OS_IDENTITY_API_VERSION=3
. I'd like to move this file somewhere so it gets automatically loaded when another user logs in using SSH.
Having read related threads, I tried adding this using this as a root user, but this only seems to add these values for the root user. When I login as another user, say 'admin01' the values are not loaded.
echo source /home/admin01/openrc>>~/.bash_profile
I also tried moving this file to /etc/profile.d, but that also seems to load only for root and not for any other user logging in. Can someone PLEASE explain what's going on.
cp /home/admin01/openrc /etc/profile.d/openrc.sh
The /etc/profile
has a warning like this;
# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.