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?
1 Answers
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/bashfrom theadminaccountsudo chsh -s /bin/bash adminfrom another user account with suitablesudoprivileges
See also Arrow keys, Home, End, tab-complete keys not working in shell
- 142,475
