PS1 The primary prompt string, which defaults to “$ ”, unless you
are the superuser, in which case it defaults to “# ”. PS1 may
include any of the following formatting sequences, which are
replaced by the given information:
\H This system's fully-qualified hostname (FQDN)
\h This system's hostname.
\u User name.
\W The final component of the current working directory.
\w The entire path of the current working directory.
\$ Superuser status. “$” for normal users and “#” for
superusers.
\\ A literal backslash.
\[ Start of a sequence of non-printing characters (used,
for example, to embed ANSI CSI sequences into the
prompt).
\] End of a sequence of non-printing characters.
The following special and non-printing characters are supported
within the sequence of non-printing characters:
\a Emits ASCII BEL (0x07, 007) character.
\e Emits ASCII ESC (0x1b, 033) character.
\r Emits ASCII CR (0x0d, 015) character.
\n Emits CRLF sequence.
If you only want the prompt to change, set the PS1 environment variable. Usually one of the shell's profile files does this. The default for the root shell is "/root/.profile".
E.g. you could echo "PS1='\u@\h # '" >> /root/.profile
See the sh manual page, especially this section:
Code:PS1 The primary prompt string, which defaults to “$ ”, unless you are the superuser, in which case it defaults to “# ”. PS1 may include any of the following formatting sequences, which are replaced by the given information: \H This system's fully-qualified hostname (FQDN) \h This system's hostname. \u User name. \W The final component of the current working directory. \w The entire path of the current working directory. \$ Superuser status. “$” for normal users and “#” for superusers. \\ A literal backslash. \[ Start of a sequence of non-printing characters (used, for example, to embed ANSI CSI sequences into the prompt). \] End of a sequence of non-printing characters. The following special and non-printing characters are supported within the sequence of non-printing characters: \a Emits ASCII BEL (0x07, 007) character. \e Emits ASCII ESC (0x1b, 033) character. \r Emits ASCII CR (0x0d, 015) character. \n Emits CRLF sequence.
Yes , for my user I use BashRoot uses sh shell by default and it looks like this, are you using different shell for the user?
cat /etc/passwd |grep -e root
xv0: ~ # set prompt = "%N : "
root:
But what console do you use for root?
cat /etc/passwd |grep -e root
Look at the end of the root user line, you have to have the console specified.
If you use csh, the variable to change the prompt is specified in .cshrc in the prompt variable, if you do not declare it the script generates an automatic prompt. You can declare it yourself, or directly modify it from the console, for example:
xv0: ~ # set prompt = "%N : "
I would leave you a prompt like:
If you are using sh, then you must follow the instructions of the other colleagues.
.xinitrcHow do you have the .xinitrc and .profile files configured?
xset r on
export QT_QPA_PLATFORMTHEME=qt5ct
fvwm3
#
# .profile - Bourne Shell startup script for login shells
#
# see also sh(1), environ(7).
#
# These are normally set through /etc/login.conf. You may override them here
# if wanted.
# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
# Setting TERM is normally done through /etc/ttys. Do only override
# if you're sure that you'll never log in via telnet or xterm or a
# serial line.
# TERM=xterm; export TERM
EDITOR=vi; export EDITOR
PAGER=less; export PAGER
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
# Let sh(1) know it's at home, despite /home being a symlink.
if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi
# Query terminal size; useful for serial lines.
if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
# Display a random cookie on each login.
#if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi
Yes an yes ..There may be your problem, when you start X the ENV variable is present? You may have to export it in xinitrc.
ENV=$HOME/.shrc; export ENV
I think you mean shell, not console.But what console do you use for root?
...
Look at the end of the root user line, you have to have the console specified.
Look into xterm (and friends) starting a new login shell versus starting a subshell. That can be configured. The same applies to su / sudo / doas.I follow the advices,and works fine, but only in pure console , the prompt change when from my user change to "sh" and when become root with "su"
the problem is in X , when use for example, xterm,lilyterm,etc
Yes, I was referring to the shellI think you mean shell, not console.
su -
I think you mean shell, not console.
Look into xterm (and friends) starting a new login shell versus starting a subshell. That can be configured. The same applies to su / sudo / doas.
And I really hope you are not running X as root, that's a very bad idea.
juan ALL=(ALL:ALL) NOPASSWD: /sbin/mount , /sbin/shutdown , /sbin/zfs
You don't need sudo to manage those permissions in ZFS, you can useNo, I use sudoers file to permit operations (mount zfs encrypted point,shutdown,etc) without become root
this is the line:
Code:juan ALL=(ALL:ALL) NOPASSWD: /sbin/mount , /sbin/shutdown , /sbin/zfs