Mailing List Archive

.bashrc for root
Hello,

Looking at: /etc/skel/.bashrc it is sourced by all bash shells on
startup. However. root does not have a /root/.bashrc file by default.

Is it ok to just create one, or is there another place for customizing
the root shells (the gentoo way)?


James


--
gentoo-user@gentoo.org mailing list
Re: .bashrc for root [ In reply to ]
I just copied tthe .bash stuff to my /root and used it. I assume it's not default so that if something goes wrong executing the .bash shells then you can still get into root.

>
> From: wireless <wireless@tampabay.rr.com>
> Date: 2004/09/13 Mon PM 07:27:16 GMT
> To: gentoo-user@lists.gentoo.org
> Subject: [gentoo-user] .bashrc for root
>
> Hello,
>
> Looking at: /etc/skel/.bashrc it is sourced by all bash shells on
> startup. However. root does not have a /root/.bashrc file by default.
>
> Is it ok to just create one, or is there another place for customizing
> the root shells (the gentoo way)?
>
>
> James
>
>
> --
> gentoo-user@gentoo.org mailing list
>
>


--
gentoo-user@gentoo.org mailing list
Re: .bashrc for root [ In reply to ]
brettholcomb@charter.net wrote:
> I just copied tthe .bash stuff to my /root and used it. I assume it's not default so that if something goes wrong executing the .bash shells then you can still get into root.
You can get in anyway, because the the /root/.bashrc is not executed
when loggin in as root, even when running a bash. You need to run/call a
_new_ bash from your prompt in order to get the script executed.

It's different of course when su-ing in an X-terminal.

Frank

--
gentoo-user@gentoo.org mailing list
Re: .bashrc for root [ In reply to ]
Okay. That sounds good. I usually su in an xterm so when I wasn't
getting my .bash* for root I copied them over. Thanks.

On Tue, 14 Sep 2004, Frank Reich wrote:

> brettholcomb@charter.net wrote:
>> I just copied tthe .bash stuff to my /root and used it. I assume it's not
>> default so that if something goes wrong executing the .bash shells then you
>> can still get into root.
> You can get in anyway, because the the /root/.bashrc is not executed when
> loggin in as root, even when running a bash. You need to run/call a _new_
> bash from your prompt in order to get the script executed.
>
> It's different of course when su-ing in an X-terminal.
>
> Frank
>
> --
> gentoo-user@gentoo.org mailing list
>
>

--
Brett I. Holcomb

--
gentoo-user@gentoo.org mailing list
Re: .bashrc for root [ In reply to ]
* Frank Reich (2004-09-14 02:16 +0200)
> brettholcomb@charter.net wrote:
>> I just copied tthe .bash stuff to my /root and used it. I assume it's not default so that if something goes wrong executing the .bash shells then you can still get into root.
> You can get in anyway, because the the /root/.bashrc is not executed
> when loggin in as root, even when running a bash.

Yes, that's why everyone sources .bashrc in .bash_profile.

> You need to run/call a
> _new_ bash from your prompt in order to get the script executed.

Nonsense.

> It's different of course when su-ing in an X-terminal.

Of course not. It's the exactly the same with an xterm and su: it only
matters if it's a login shell or not.

Thorsten


--
gentoo-user@gentoo.org mailing list
Re: Re: .bashrc for root [ In reply to ]
Thorsten Kampe wrote:
> Yes, that's why everyone sources .bashrc in .bash_profile.
Users usually get this file when being created with
useradd [...] -m [...]
from the skeleton_dir.

Since this command is hardly executed for creating the root-user simply
not everyone automatically has this file in his /root/.

>>You need to run/call a
>>_new_ bash from your prompt in order to get the script executed.
> Nonsense.
No, it's true in lack of .bash_profile ;-) One might decide to keep it
that way in order to prevent any problems which might appear with using
.bashrc, let's say after updating bash. 'Course I realize the
unlikelihood in that point, so I copied the .bash_profile to /root/ an
that's it.

>>It's different of course when su-ing in an X-terminal.
> Of course not. It's the exactly the same with an xterm and su: it only
> matters if it's a login shell or not.
Thanks for straighting that out. Still, the effects are the way I wrote.
That's why I don't get the "exactly the same". Nevermind.

Frank

--
gentoo-user@gentoo.org mailing list
Re: Re: .bashrc for root [ In reply to ]
Frank Reich wrote:
> Thorsten Kampe wrote:
>
>> Yes, that's why everyone sources .bashrc in .bash_profile.
>
> Users usually get this file when being created with
> useradd [...] -m [...]
> from the skeleton_dir.
>
> Since this command is hardly executed for creating the root-user simply
> not everyone automatically has this file in his /root/.
>
>>> You need to run/call a _new_ bash from your prompt in order to get
>>> the script executed.
>>
>> Nonsense.
>
> No, it's true in lack of .bash_profile ;-) One might decide to keep it
> that way in order to prevent any problems which might appear with using
> .bashrc, let's say after updating bash. 'Course I realize the
> unlikelihood in that point, so I copied the .bash_profile to /root/ an
> that's it.
>
>>> It's different of course when su-ing in an X-terminal.
>>
>> Of course not. It's the exactly the same with an xterm and su: it only
>> matters if it's a login shell or not.
>
I just created the /root/.profile and /root/.bashrc files, similar to
my debian files and all is well with root, whether I ssh in or su from
a user account.


Thanks everyone!

James


--
gentoo-user@gentoo.org mailing list