Root users in linux cannot switch su to admin users.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.