In the newly installed debian server, bash under root has configurations such as username@current directory, arrow keys and shortcut keys available, but when I create a new user, there are no related functions. Shouldn't the configuration that root can use be the global configuration in etc? How to let new users have the same bash configuration as root.
Solved, the reason is that the default shell for new users is not bash
Generally speaking,
/root/.bashrc
is root’s private bash configuration. Copy this file to/home/username/.bashrc
, and new users can use the same configuration as root. In addition, some special configurations for the root user in.bashrc
need to be changed after copying.For
Debian/Ubuntu-like systems, by default,
bashwill execute
/etc/bash.bashrcfirst, and then execute the
~/.bashrcfile. If no
~/.bashrcfile exists, It will also execute
/etc/bash.bashrc, which means there is a default configuration.