0

I have no idea what is the topic of my problem.

I have to change the user using su user when accessing the server with ssh user@server

The initial terminal shows just > without a user name (i.e., user@server >) before the change user (i.e., su user)

The process is so bothering me. Please note the reason, answer.

Thanks

wazz
  • 31
  • 1
    What does id -un show when you initially log in on the remote machine. What shell is being used and what does echo "$-" output? My thinking is that you've logged in as the correct user, but that one of the shell's initialization files (that sets the prompt) just isn't executed. – Kusalananda Jun 12 '20 at 07:29
  • The shell prompt is very customizable. Maybe the server administrator has changed the default prompt to > for some reason: perhaps an attempt to increase security by making the system more obscure? A need to satisfy some contract or security audit requirement to minimize the amount of information displayed? Personal preference? The only way to know the fundamental reason would be to ask the server administrator about it. – telcoM Jun 12 '20 at 07:36
  • @Kusalananda The remote machine shows the user name when id -un. And the echo "$-" shows smi – wazz Jun 17 '20 at 00:57
  • Ok, so you just have the wrong prompt, not the wrong user account. Is the PS1 variable (the primary prompt) set in ~/.bashrc or in ~/.bash_profile on the remote system (assuming you're using the bash shell)? – Kusalananda Jun 17 '20 at 08:23
  • @Kusalananda Yes, there is in ~/.bashrc with the following:

    `if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$ ' fi unset color_prompt force_color_prompt

    If this is an xterm set the title to user@host:dir

    case "$TERM" in xterm|rxvt) PS1="[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a]$PS1" ;; *) ;; esac `

    – wazz Jun 17 '20 at 11:30

0 Answers0