Hi folks. Just wondering how I can implement an automatic .bash_profile for root. I have to load my user .bash_profile every time I get into root, and I would like a better solution. There is no /home/ for root, so I’m a bit confused if this is even allowed.
Any insight appreciated.
Cheers, Bee
Hi,
The $home of root is /root, just copy it there.
-- Sent from the Delta quadrant using Borg technology!
Nux! www.nux.ro
----- Original Message -----
From: "Bee.Lists" bee.lists@gmail.com To: "CentOS mailing list" centos@centos.org Sent: Monday, 13 May, 2019 13:28:24 Subject: [CentOS] root .bash_profile?
Hi folks. Just wondering how I can implement an automatic .bash_profile for root. I have to load my user .bash_profile every time I get into root, and I would like a better solution. There is no /home/ for root, so I’m a bit confused if this is even allowed.
Any insight appreciated.
Cheers, Bee
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On 2019-05-13 07:38, Nux! wrote:
Hi,
The $home of root is /root, just copy it there.
It is $HOME not $home ;-)
Valeri
-- Sent from the Delta quadrant using Borg technology!
Nux! www.nux.ro
----- Original Message -----
From: "Bee.Lists" bee.lists@gmail.com To: "CentOS mailing list" centos@centos.org Sent: Monday, 13 May, 2019 13:28:24 Subject: [CentOS] root .bash_profile?
Hi folks. Just wondering how I can implement an automatic .bash_profile for root. I have to load my user .bash_profile every time I get into root, and I would like a better solution. There is no /home/ for root, so I’m a bit confused if this is even allowed.
Any insight appreciated.
Cheers, Bee
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Ah thank you. Having forgotten this, I already had all my aliases and instructions in there. For some reason they aren’t loading. If I do this, then everything loads:
source /root/.bash_profile
So there’s an indication this isn’t loading upon entry into su. Is this normal?
On May 13, 2019, at 8:38 AM, Nux! nux@li.nux.ro wrote:
Hi,
The $home of root is /root, just copy it there.
Cheers, Bee
On Mon, 2019-05-13 at 13:06 -0400, Bee.Lists wrote:
Ah thank you. Having forgotten this, I already had all my aliases and instructions in there. For some reason they aren’t loading. If I do this, then everything loads:
source /root/.bash_profile
So there’s an indication this isn’t loading upon entry into su. Is this normal?
$ man bash, search on INVOCATION
On May 13, 2019, at 8:38 AM, Nux! nux@li.nux.ro wrote:
Hi,
The $home of root is /root, just copy it there.
Cheers, Bee
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
$ man bash (INVOCATION)
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
But the reference to .bash_profile has some unclear restrictions or boundaries:
~/.bash_profile The personal initialization file, executed for login shells
First, the ~ which might not apply to root. Second, it’s a “personal” init file, which also might not pertain to root. Going from user to root (su) might not initiate a login shell. I’m not clear on this.
But, .bash_profile is not loading.
I have my aliases in another file called /root/.bash_aliases, which is a duplicate of my /home/myuser/.bash_aliases which is NOW sourced in my /root/.bashrc so it now works.
So ya, got it to work, but knowing the cascade of inclusions is important. root is as important to me as my normal user.
On May 13, 2019, at 1:17 PM, Christian, Mark mark.christian@intel.com wrote:
$ man bash, search on INVOCATION
Cheers, Bee
~/.bash_profile The personal initialization file, executed for login shells
First, the ~ which might not apply to root.
Why do you think that? '~' is just shell shorthand for user's home directory.
Second, it’s a “personal” init file, which also might not pertain to root.
root is just as much a user as anyone else, albeit one with special privileges because they are UID 0.
Going from user to root (su) might not initiate a login shell. I’m not clear on this.
Are you logging in? (i.e. typing the username and password at a login prompt.) If not, then it's not a login shell.
But, .bash_profile is not loading.
I have my aliases in another file called /root/.bash_aliases, which is a duplicate of my /home/myuser/.bash_aliases which is NOW sourced in my /root/.bashrc so it now works.
So ya, got it to work, but knowing the cascade of inclusions is important. root is as important to me as my normal user.
Yes. If you are going to be playing around as root, then you really should know the consequences of what you are doing. When I started using Unix 30mumble years ago, the perceived wisdom was *always* invoke su as /bin/su, those where the days when '.' was frequently in a users path and some nasty user might leave scripts called 'su' lying around waiting for an admin to occidentally execute them. Second, invoke it as '/bin/su -', that way you clean out any user variables and only have the environment you have setup for root.
P.
On May 13, 2019, at 2:46 PM, Pete Biggs pete@biggs.org.uk wrote:
First, the ~ which might not apply to root.
Why do you think that? '~' is just shell shorthand for user's home directory.
root quite often isn’t recognized as a proper user. ~/.bash_profile isn’t loaded because it’s not a normal login shell when entering `su`.
Second, it’s a “personal” init file, which also might not pertain to root.
root is just as much a user as anyone else, albeit one with special privileges because they are UID 0.
So I can’t assume it’s just another user.
Going from user to root (su) might not initiate a login shell. I’m not clear on this.
Are you logging in? (i.e. typing the username and password at a login prompt.) If not, then it's not a login shell.
Isn’t moving from my own user using su, then prompted for password count as a login?
But, .bash_profile is not loading.
I have my aliases in another file called /root/.bash_aliases, which is a duplicate of my /home/myuser/.bash_aliases which is NOW sourced in my /root/.bashrc so it now works.
So ya, got it to work, but knowing the cascade of inclusions is important. root is as important to me as my normal user.
Yes. If you are going to be playing around as root, then you really should know the consequences of what you are doing. When I started using Unix 30mumble years ago, the perceived wisdom was *always* invoke su as /bin/su, those where the days when '.' was frequently in a users path and some nasty user might leave scripts called 'su' lying around waiting for an admin to occidentally execute them. Second, invoke it as '/bin/su -', that way you clean out any user variables and only have the environment you have setup for root.
man su doesn’t apply to root with regards to the files loaded up upon login. Consequences of reading generic man pages result in more than one option.
Cheers, Bee
On Mon, May 13, 2019 at 04:20:17PM -0400, Bee.Lists wrote:
On May 13, 2019, at 2:46 PM, Pete Biggs pete@biggs.org.uk wrote: Why do you think that? '~' is just shell shorthand for user's home directory.
root quite often isn’t recognized as a proper user. ~/.bash_profile isn’t loaded because it’s not a normal login shell when entering `su`.
You'd find that if there's another user account on your system (lets call it "fred"), and you ran 'su fred', it would not load ~fred/.bash_profile either, because it wasn't a login shell. 'root' isn't special here.
Isn’t moving from my own user using su, then prompted for password count as a login?
As you read in the 'bash' man page, files that are loaded with a "login shell" are different from files loaded from a normal shell execution. 'su' has specific syntax for either running a shell as a user or running a login shell as a user. Just typing a password at the prompt doesn't mean it was a login shell.
Typically, a 'login shell' is what you get when you log into a system through login: or a graphical login. .bash_profile is loaded once when you log in. It's meant for login stuff. .bashrc is loaded for every shell you start.
'su' is a tool used to switch users, so you are given the option to either start a shell as a user or log in as that user, depending on the situation.
man su doesn’t apply to root with regards to the files loaded up upon login. Consequences of reading generic man pages result in more than one option.
The 'su' man page explains all of this pretty well I think. Becoming root isn't special, in terms of loading .bash_profile vs. .bashrc.
But it is different. Significantly different.
I’d rather just use ‘su’ and have the login sequence trip the loading of my aliases. Moving this to .bashrc has solved that. That’s what I was asking.
On May 13, 2019, at 4:37 PM, Jonathan Billings billings@negate.org wrote:
The 'su' man page explains all of this pretty well I think. Becoming root isn't special, in terms of loading .bash_profile vs. .bashrc.
Cheers, Bee
On Mon, 2019-05-13 at 16:20 -0400, Bee.Lists wrote:
On May 13, 2019, at 2:46 PM, Pete Biggs pete@biggs.org.uk wrote:
First, the ~ which might not apply to root.
Why do you think that? '~' is just shell shorthand for user's home directory.
root quite often isn’t recognized as a proper user. ~/.bash_profile isn’t loaded because it’s not a normal login shell when entering `su`.
If you switch to any other user using 'su', then their .bash_profile isn't loaded (unless you specify that it's a login shell). 'su' doesn't mean "super user" it means "substitute user" - the default happens to be user UID 0.
Second, it’s a “personal” init file, which also might not pertain to root.
root is just as much a user as anyone else, albeit one with special privileges because they are UID 0.
So I can’t assume it’s just another user.
It may not be "just another user", but it *is* a user as much as your login username is a user. You could assign your own username a UID of 0, and it would have the same privileges as 'root', but it would still act as your username. NOTE: doing this is NOT recommended, do not do it, seriously, do NOT do it.
Going from user to root (su) might not initiate a login shell. I’m not clear on this.
Are you logging in? (i.e. typing the username and password at a login prompt.) If not, then it's not a login shell.
Isn’t moving from my own user using su, then prompted for password count as a login?
No. It doesn't. The password prompt is for authentication, not logging in.
man su doesn’t apply to root with regards to the files loaded up upon login.
Could you explain what you mean by that.
P.
On 2019-05-13 16:25, Pete Biggs wrote:
On Mon, 2019-05-13 at 16:20 -0400, Bee.Lists wrote:
On May 13, 2019, at 2:46 PM, Pete Biggs pete@biggs.org.uk wrote:
First, the ~ which might not apply to root.
Why do you think that? '~' is just shell shorthand for user's home directory.
root quite often isn’t recognized as a proper user. ~/.bash_profile isn’t loaded because it’s not a normal login shell when entering `su`.
If you switch to any other user using 'su', then their .bash_profile isn't loaded (unless you specify that it's a login shell).
Whole environment of user that invoked su is "inherited" unless it is specified on commend line to get login environment of user one does su into.
'su' doesn't mean "super user" it means "substitute user" - the default happens to be user UID 0.
Thanks Pete! This really needs to be repeated, even though whenever su is mentioned I repeat that to my users that it means "substitute user", but now that you mentioned it here it makes this whole thread clear.
Valeri
Second, it’s a “personal” init file, which also might not pertain to root.
root is just as much a user as anyone else, albeit one with special privileges because they are UID 0.
So I can’t assume it’s just another user.
It may not be "just another user", but it *is* a user as much as your login username is a user. You could assign your own username a UID of 0, and it would have the same privileges as 'root', but it would still act as your username. NOTE: doing this is NOT recommended, do not do it, seriously, do NOT do it.
Going from user to root (su) might not initiate a login shell. I’m not clear on this.
Are you logging in? (i.e. typing the username and password at a login prompt.) If not, then it's not a login shell.
Isn’t moving from my own user using su, then prompted for password count as a login?
No. It doesn't. The password prompt is for authentication, not logging in.
man su doesn’t apply to root with regards to the files loaded up upon login.
Could you explain what you mean by that.
P.
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On 13/05/2019 22:25, Pete Biggs wrote:
On Mon, 2019-05-13 at 16:20 -0400, Bee.Lists wrote:
<snip>
It may not be "just another user", but it *is* a user as much as your login username is a user. You could assign your own username a UID of 0, and it would have the same privileges as 'root', but it would still act as your username. NOTE: doing this is NOT recommended, do not do it, seriously, do NOT do it.
<snip>
P.
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Shame that "security experts" regularly recommend using another name for the root account - security through obscurity anyone?
On 2019-05-13 16:55, J Martin Rushton via CentOS wrote:
On 13/05/2019 22:25, Pete Biggs wrote:
On Mon, 2019-05-13 at 16:20 -0400, Bee.Lists wrote:
<snip> > > It may not be "just another user", but it *is* a user as much as your > login username is a user. You could assign your own username a UID of > 0, and it would have the same privileges as 'root', but it would still > act as your username. NOTE: doing this is NOT recommended, do not do > it, seriously, do NOT do it. > <snip> > P. > > > _______________________________________________ > CentOS mailing list > CentOS@centos.org > https://lists.centos.org/mailman/listinfo/centos >
Shame that "security experts" regularly recommend using another name for the root account - security through obscurity anyone?
Not here, sorry ;-)
Valeri
PS Script kiddies will get UID=0, not username=root, when succeed in pretty much anything they use to elevate privileges on attacked machine.
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Shame that "security experts" regularly recommend using another name for the root account - security through obscurity anyone?
Unfortunately anyone can call themselves an "expert".
If your protection against a UID 0 login is to change the username, then you need to seriously look at (a) your password policy and (b) letting root login in the first place.
P.
su does not load .bash_profile and therefore is a completely different application than with any other user. This one is different, considering .bash_profile is indeed used for logins for other users.
On May 13, 2019, at 5:25 PM, Pete Biggs pete@biggs.org.uk wrote:
man su doesn’t apply to root with regards to the files loaded up upon login.
Could you explain what you mean by that.
Cheers, Bee
On Tue, 14 May 2019, Bee.Lists wrote:
su does not load .bash_profile and therefore is a completely different application than with any other user. This one is different, considering .bash_profile is indeed used for logins for other users.
You misunderstand. su behaves the same when switching to root as to any other account.
su -
is probably the command you're looking for.
jh
OK I think you need to read previous posts on this.
I’m not looking for any other command.
On May 14, 2019, at 5:10 AM, John Hodrien J.H.Hodrien@leeds.ac.uk wrote:
You misunderstand. su behaves the same when switching to root as to any other account.
su -
is probably the command you're looking for.
Cheers, Bee
On Tue, May 14, 2019 at 05:19:57AM -0400, Bee.Lists wrote:
OK I think you need to read previous posts on this.
I’m not looking for any other command.
Please stop top-posting, thank you.
It's the _same command_; all it is is a different invocation method using an additional argument.
John
On May 14, 2019, at 5:50 AM, John R. Dennison jrd@gerdesas.com wrote:
On Tue, May 14, 2019 at 05:19:57AM -0400, Bee.Lists wrote:
OK I think you need to read previous posts on this.
I’m not looking for any other command.
Please stop top-posting, thank you.
It's the _same command_; all it is is a different invocation method using an additional argument.
John
-- We're not ending the journey today, we're completing a chapter of a journey that will never end. Let's light this shuttle one more time ... and witness this nation at its best. The crew of Atlantis is ready to launch.
-- Atlantis Commander Chris Ferguson, just before the 11:29:29am EDT launch of STS-135, the final Space Shuttle mission, 8 July 2011 _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
I addressed this in the thread.
Cheers, Bee
On Tue, May 14, 2019 at 07:45:55AM -0400, Bee.Lists wrote:
I addressed this in the thread.
And we continue to tell you that you're wrong. su behaves the same way when switching to any other user as it does for root. Stop spreading misinformation.
On May 14, 2019, at 8:14 AM, Jonathan Billings billings@negate.org wrote:
On Tue, May 14, 2019 at 07:45:55AM -0400, Bee.Lists wrote:
I addressed this in the thread.
And we continue to tell you that you're wrong. su behaves the same way when switching to any other user as it does for root. Stop spreading misinformation.
Not big on reading what I put. It’s all there. Regardless how often you say ‘su’ is the same as ‘su fred’, it is not. Stop spreading misinformation.
Cheers, Bee
On 2019-05-14 09:07, Bee.Lists wrote:
On May 14, 2019, at 8:14 AM, Jonathan Billings billings@negate.org wrote:
On Tue, May 14, 2019 at 07:45:55AM -0400, Bee.Lists wrote:
I addressed this in the thread.
And we continue to tell you that you're wrong. su behaves the same way when switching to any other user as it does for root. Stop spreading misinformation.
Not big on reading what I put. It’s all there. Regardless how often you say ‘su’ is the same as ‘su fred’, it is not. Stop spreading misinformation.
Look, in the following four command lines executed in the shell:
su
su fred
su - fred
su -l fred
- in all four of them:
"su" is a command
"fred" is an argument (wherever it is present)
"-" (surrounded by spaces on both sides) and "-l" are command options
This is standard terminology used in UNIX, Linux, etc for several decades. And finally, RTFM, please.
And also, can we close this thread, please.
Valeri
Cheers, Bee
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On May 14, 2019, at 10:23 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Look, in the following four command lines executed in the shell:
su
su fred
su - fred
su -l fred
- in all four of them:
"su" is a command
"fred" is an argument (wherever it is present)
"-" (surrounded by spaces on both sides) and "-l" are command options
This is standard terminology used in UNIX, Linux, etc for several decades. And finally, RTFM, please.
And also, can we close this thread, please.
Just wow. No point in even posting in here anymore.
Cheers, Bee
On 2019-05-14 07:14, Jonathan Billings wrote:
On Tue, May 14, 2019 at 07:45:55AM -0400, Bee.Lists wrote:
I addressed this in the thread.
And we continue to tell you that you're wrong. su behaves the same way when switching to any other user as it does for root. Stop spreading misinformation.
Sorry, Jonathan, that I replying _your_ message, my reply has nothing to do with it of any of your other posts, but rather with some posts by some other posters. I really have to say this:
This whole thread - some posts in it that is - reminds me the old truth: RTFM. Namely, Read The F.. (damn) Manual!
It is really hard to help those who don't care to read the man page. No matter how many times you repeat that su stands for "substitute user", and that the command as usually may have various options, and "-" is one of these options, and what is the difference between invoking command with or without it.
I would suggest that continuing this thread is counter-productive.
Valeri
PS pasting excerpt from "man su" on my FreeBSD workstation:
SU(1) FreeBSD General Commands Manual SU(1)
NAME su - substitute user identity
SYNOPSIS su [-] [-c class] [-flms] [login [args]]
...
-l Simulate a full login. ...
- (no letter) The same as -l.
On May 14, 2019, at 10:13 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Sorry, Jonathan, that I replying _your_ message, my reply has nothing to do with it of any of your other posts, but rather with some posts by some other posters. I really have to say this:
This whole thread - some posts in it that is - reminds me the old truth: RTFM. Namely, Read The F.. (damn) Manual!
It is really hard to help those who don't care to read the man page. No matter how many times you repeat that su stands for "substitute user", and that the command as usually may have various options, and "-" is one of these options, and what is the difference between invoking command with or without it.
I would suggest that continuing this thread is counter-productive.
Then reply to them. Is it that hard?
Second, if you READ the posts, you would find that the man page, is unclear. It was referred to, but you missed that as well.
It’s really hard to post things when people like you two don’t read the frickin posts. No matter how many times you post, most people just want to fluff their feathers instead of read the posts.
I would suggest…reading the posts. Then, read the posts. Or get some fresh air. None of this is difficult.
Cheers, Bee
On Tue, May 14, 2019 at 10:23:20AM -0400, Bee.Lists wrote:
Second, if you READ the posts, you would find that the man page, is unclear. It was referred to, but you missed that as well.
No, it's really not. This is reinforced by the fact that you are the sole person having an issue grasping how this all works and would rather argue your incorrect point of view (and getting the last word in) than accept that you might be wrong and others might be right. The people that have chimed in have a combined experience of _well_ over a hundred years. Might just be they know a thing or 10?
If you find the man page confusing for whatever reason there is a SEE ALSO section that points you to the GNU info page for it, including the exact command line necessary to see the invocation specifics; GNU info pages are generally far more fleshed out than man pages. You might need to install the info package but it may be worth it for the additional information source.
It’s really hard to post things when people like you two don’t read the frickin posts. No matter how many times you post, most people just want to fluff their feathers instead of read the posts.
This argumentative nature you are displaying is not going to make people want to help you further.
I would suggest…reading the posts. Then, read the posts. Or get some fresh air. None of this is difficult.
I would encourage you to do the same with a bit more open mind and the understanding that perhaps, just maybe, when you come to a support list asking for assistance that the assistance you get might actually be, shocking as it may seem, correct.
John
On Tue, 2019-05-14 at 05:19 -0400, Bee.Lists wrote:
OK I think you need to read previous posts on this.
I’m not looking for any other command.
How are 'su' and 'su -' different commands?
If you really dislike typing the extra "<space> '-'", then setup an alias so you only have to type "'s' 'u'" to get it to do what you want.
P.
On May 14, 2019, at 6:06 AM, Pete Biggs pete@biggs.org.uk wrote:
OK I think you need to read previous posts on this.
I’m not looking for any other command.
How are 'su' and 'su -' different commands?
If you really dislike typing the extra "<space> '-'", then setup an alias so you only have to type "'s' 'u'" to get it to do what you want.
P.
If you look, they are not the same. One has a parameter. My fix was to park the source into .bashrc and it now works.
Cheers, Bee
On Tue, 2019-05-14 at 04:50 -0400, Bee.Lists wrote:
su does not load .bash_profile and therefore is a completely different application than with any other user. This one is different, considering .bash_profile is indeed used for logins for other users.
su is an application for switching from one user to another. It behaves the same way whether you are switching from user A to user B, or to user root.
su is NOT the same as logging in with that user ID. If you login as root at the console, root's .bash_profile would be read.
P.
On May 14, 2019, at 6:02 AM, Pete Biggs pete@biggs.org.uk wrote:
su is NOT the same as logging in with that user ID. If you login as root at the console, root's .bash_profile would be read.
I can count those instances on one hand over the last 40 years. Hence the question of switching from another user. I covered that in the thread.
Cheers, Bee
On Mon, May 13, 2019 at 01:39:27PM -0400, Bee.Lists wrote:
$ man bash (INVOCATION)
You might also benefit from reading the man page for 'su', which will explain why running 'su -' is different from running 'su'.
On Mon, 2019-05-13 at 08:28 -0400, Bee.Lists wrote:
Hi folks. Just wondering how I can implement an automatic .bash_profile for root. I have to load my user .bash_profile every time I get into root, and I would like a better solution. There is no /home/ for root, so I’m a bit confused if this is even allowed.
Any insight appreciated.
Cheers, Bee
For a "normal" installation root's home directory is /root
From a users account the "-" will source /root/.bash_profile
and change to root's home directory. ja@naxos ~ 1$ su - Password: [root@naxos:~]$ pwd /root [root@naxos:~]$
For the occasions when it is desirable NOT to cd /root
I have an alias in /root/.bashrc alias sbp='source ~/.bash_profile'
ja@naxos ~ 2$ pwd /home/ja ja@naxos ~ 3$ su Password: root@naxos ja 1001$ pwd /home/ja root@naxos ja 1002$ sbp [root@naxos:/home/ja]$ pwd /home/ja
/root/.bash_profile changes the colour of the prompt (among other things) PS1="[\033[1;31m][\u@\h:\w]$[\033[0m] "
There must be much better ways of doing this!
OK, I haven’t tested for that loadup yet, and the .bashrc is indeed there. I thought .bashrc was loaded first, then .bash_profile. This is for normal user.
Just tested it again, and /root/.bash_profile is not loading. Tried this in /root/.bashrc:
source /root/.bash_profile
That created a loop, because that reverse instruction is inside /root/.bash_profile
So for some reason, entering su isn’t loading its own .bash_profile nor keeping my user’s .bash_profile (expected).
Any ideas?
On May 13, 2019, at 8:49 AM, ja ja@jaa.org.uk wrote:
I have an alias in /root/.bashrc alias sbp='source ~/.bash_profile'
Cheers, Bee
On Mon, 13 May 2019 at 08:28, Bee.Lists bee.lists@gmail.com wrote:
Hi folks. Just wondering how I can implement an automatic .bash_profile for root. I have to load my user .bash_profile every time I get into root, and I would like a better solution. There is no /home/ for root, so I’m a bit confused if this is even allowed.
Most Linux distributions since the mid 1990's have made /root the home directory for their UID 0 user. This was because /home was not guaranteed to be mounted when the system started up AND people were annoyed with the Unix tradition of having UID 0 with the / as the home directory. [Having UID 0 with / caused all kinds of file components to show up in / and sometimes with the worst permissions.. so any user might source through /.history and find some password etc.]
While moving /root to /home/root is done in someplaces, it only works if /home is not on a different partition. If you put /home on a different partition you will find all kinds of weird behavior happening on start up.
Any insight appreciated.
Cheers, Bee
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
No, this isn’t a case of multi partitions, clusters, or anything silly. I just want a set of aliases loaded for su. /root/.bash_profile isn’t loading, and there isn’t any obvious choice as to where the loaded .bash* were loading from.
On May 13, 2019, at 9:11 AM, Stephen John Smoogen smooge@gmail.com wrote:
While moving /root to /home/root is done in someplaces, it only works if /home is not on a different partition. If you put /home on a different partition you will find all kinds of weird behavior happening on start up.
Cheers, Bee
Once upon a time, Bee.Lists bee.lists@gmail.com said:
No, this isn’t a case of multi partitions, clusters, or anything silly. I just want a set of aliases loaded for su. /root/.bash_profile isn’t loading, and there isn’t any obvious choice as to where the loaded .bash* were loading from.
.bash_profile will not be read when you just run "su", because .bash_profile is read in a login shell, and "su" does not create a login shell.
.bashrc will be read (and is really where aliases belong anyway), or you can "su -" to create a login shell.
OK that’s exactly what I just was questioning. The documentation wasn’t clear on the ‘man bash’ (INVOCATION) notes.
So I entered my inclusion of my aliases file (it’s my own) inside .bashrc.
Thank you
On May 13, 2019, at 1:31 PM, Chris Adams linux@cmadams.net wrote:
.bash_profile will not be read when you just run "su", because .bash_profile is read in a login shell, and "su" does not create a login shell.
.bashrc will be read (and is really where aliases belong anyway), or you can "su -" to create a login shell.
Cheers, Bee