Article Title: root users in linux cannot switch su to admin users. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I found a strange problem today. I have been wondering for a long time. The root user cannot switch su to the admin user.
It's strange that the root user does not have the highest system permissions. Because it is on the server, you cannot delete the admin user and add it again. The day after tomorrow, I found it was a problem with the. bashrc configuration file. It turns out that today I want the environment variables defined in. bash_profile to take effect immediately for every user logging on to this server. Therefore, a line is added to. bashrc:
[Admin @ host1031 ~] $ Cat. bashrc
#. Bashrc
# User specific aliases and functions
Source. bash_profile
# Source global definitions
If [-f/etc/bashrc]; then
./Etc/bashrc
Fi
The. bash_profile file is:
#. Bash_profile
# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi
# User specific environment and startup programs
Unset USERNAME
Export HIVE_HOME =/home/admin/hive/bin
Export JAVA_HOME =/home/admin/jdk1.6.0 _ 13
Export HADOOP_HOME =/home/admin/hadoop
Export ORACLE_BASE =/home/admin/oracle64
Export ORACLE_HOME = $ ORACLE_BASE
Export NLS_DATE_FORMAT = 'yyyy-MM-DD HH24: MI: ss'
Export LANG = en_US
Export NLS_LANG = american_america.zhs16gbk
Export TNS = $ ORACLE_HOME/network/admin
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib: $ LD_LIBRARY_PATH:/usr/local/lib;
Export PATH = $ JAVA_HOME/bin: $ PATH: $ HOME/bin:/home/admin/hadoop/bin
We can see that "source. bash_profile" is called in the. bashrc file, and ". ~" is called in the. bash_profile file. /. Bashrc ", this is the cup, an endless loop, resulting in the root user cannot su to the admin user.