-1

Why when I try to switch user, my console change name from this (%username%@laba2docker) to this ($). I don't have autocomplete in this mode. How can i fix it?

enter image description here

comm1ted
  • 1,046

1 Answers1

2

The "fancy" prompt and completion are features of the shell - it looks like your regular user is using bash whereas you are getting a simpler shell (most likely dash, as the default /bin/sh) when switched to the admin user.

By default, the utli-linux implementation of the su command selects the shell to use according to the following rules (from man su):

       •   the shell specified with --shell
   •   the shell specified in the environment variable SHELL, if the
       --preserve-environment option is used

   •   the shell listed in the passwd entry of the target user

   •   /bin/sh

Since you didn't specify a shell with --shell or use the --preserve-environment option, it is likely that the admin user's login shell is either set to /bin/sh or not set at all - you can use the chsh utility to set or change it:

  • chsh -s /bin/bash from the admin account

  • sudo chsh -s /bin/bash admin from another user account with suitable sudo privileges

See also Arrow keys, Home, End, tab-complete keys not working in shell

steeldriver
  • 136,215
  • 21
  • 243
  • 336