Discussion:
ignore user rc/profile files when ssh to the use login shell (bash)
(too old to reply)
Kobe Meshita
2018-08-23 15:29:56 UTC
Permalink
Hi,

You may know for any way to NOT load user files ~/.profile ~/.bashrc etc.. but only the global file /etc/profile
when login interactively to a machine?

In general my users homdir are at NFS and home is shared between other linux distros with some default to tcsh,
what I want is to manage it throw /etc/profile of each machine,

For example when user ssh to let's say Ubuntu, in /etc/profile I'll set dedicated file for user to configure.. so if ~/.ubu_profile source it..

Is that hardcoded in bash source-code to load files from user home?

GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


Thanks in advance,
Kobe.
Jesse Hathaway
2018-08-23 17:41:53 UTC
Permalink
Post by Kobe Meshita
You may know for any way to NOT load user files ~/.profile ~/.bashrc etc.. but only the global file /etc/profile
when login interactively to a machine?
you could put something like this in your /etc/profile:

exec bash --rcfile /etc/profile-real -i

And then add any configuration you need to /etc/profile-real
Eduardo Bustamante
2018-08-23 18:04:57 UTC
Permalink
Post by Jesse Hathaway
Post by Kobe Meshita
You may know for any way to NOT load user files ~/.profile ~/.bashrc etc.. but only the global file /etc/profile
when login interactively to a machine?
exec bash --rcfile /etc/profile-real -i
And then add any configuration you need to /etc/profile-real
You might also have to provide a --norc and --noprofile
Kobe Meshita
2018-08-24 10:51:46 UTC
Permalink
Thanks guys,
seems to work :)

-----Original Message-----
From: Eduardo Bustamante [mailto:***@gmail.com]
Sent: Thursday, August 23, 2018 9:05 PM
To: ***@mbuki-mvuki.org
Cc: Kobe Meshita; help-bash
Subject: Re: [Help-bash] ignore user rc/profile files when ssh to the use login shell (bash)
Post by Jesse Hathaway
Post by Kobe Meshita
You may know for any way to NOT load user files ~/.profile ~/.bashrc etc.. but only the global file /etc/profile
when login interactively to a machine?
exec bash --rcfile /etc/profile-real -i
And then add any configuration you need to /etc/profile-real
You might also have to provide a --norc and --no

Loading...