Configuring Bash

Derek Ragona derek at computinginnovations.com
Thu May 15 01:21:16 UTC 2008


At 08:10 PM 5/14/2008, Montag wrote:
> > ### SNIP ###
> > Are you saying it works if you:
> > su - root
>
>Yes, that's correct.
>
> > But logging in as a regular user.  So, can you:
> > login as a regular user
> > su - root
> > su - [regular user]
>
>Interesting, this produces the correct output.
>
>Login   :   ${PS1} $ $                   (Wrong)
>su-root :   [root at host-- /home/user]#    (Correct)
>su-user :   [user at host-- ~]$             (Correct)
>exit    :   [root at host-- /home/user]#    (Correct)
>exit    :   ${PS1} $ $                   (Wrong)
>
>This does not really jive with what I read in the man pages.  It said
>that .bash_login is invoked during login, while .bashrc is used when an
>interactive shell that is not a login shell is started.  Currently I do
>not even have a .bashrc defined, so the only thing that should be
>getting used is .bash_profile.  Why does su invoke .bash_profile?
>
>The relevant entries from /etc/password are:
>root:*:0:0:Charlie &:/root:/usr/local/bin/bash
>user:*:1001:0:User &:/home/user:/usr/local/bin/bash

I would try adding the prompt to .bashrc too, worst case it will redefine 
it the same prompt making login take a fraction longer.

Also be sure:
/home/user
is owned by user  and has the correct group too.

By the way, if the man pages are out of sync, it wouldn't be the first time.

         -Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the freebsd-questions mailing list