How to deal with the unresponsive situation of the su command in Linux

  
                

In the previous article, the su command was introduced. The su command is used for normal user and super user switching. However, in some systems, the su command does not respond. How to deal with this situation? Let's take a look at the unresolved processing method of the su command under Linux.

The problematic system CentOS 6.3 64-bit, SSH client uses SecureCRT, need friends can refer to the next

First, the problem-producing environment

CentOS 6.3 X64< Br>

SecureCRT 7.0.0 English

Second, the problem description

When I operate my own Linux server today, suddenly the su command is not good, type the command back After the car, there is no reaction, whether it is su or su - the same, after restarting the system is still the problem, depressed and terrible. . .

The most patient one waited for about 1 minute, and the su: the character behind it was a garbled prompt. At the time, there was no screenshot. Now I don't want to restore the problem. Let me talk about the cause and solution of the problem.

Third, the cause of the problem

Depressed for a long time, only to remember the last action before logging out is to modify the character encoding settings in SecureCRT, set the path:

code is as follows:

Options "Session Options" Terminal "Appearance" Character encoding "is set to the default UTF-8

as shown below:

modified The reason for UTF-8 is that when using vi to edit the configuration file with Chinese in the system, garbled characters appear, so according to the previous experience, the character encoding in SecureCRT is set to UTF-8, so that it will not be garbled.

The problem is that there is no problem in setting up this system before reinstalling the system, that is, it will not cause the su command to appear unresponsive. It is very strange. I think about it again. It seems to have been modified a few days ago. CentOS i18n configuration, current i18n configuration

Code is as follows:

#LANG=“en_US.UTF-8”

#SYSFONT=“latarcyrheb-sun16&rdquo ;

LANG=“zh_CN.GB18030”

LANGUAGE=“zh_CN.GB18030:zh_CN.GB2312:zh_CN”

SUPPORTED=“zh_CN.UTF-8 :zh_CN:zh:en_US.UTF-8:en_US:en”

SYSFONT=“lat0-sun16”

I remember that the reason for modifying this configuration at the time was also to solve the garbled problem, combined with the current Question, Imagine the possible reasons for the problem, and then tested it, and it is as expected.

Reason summary: If the i18n language configuration is Chinese and the SecureCRT Character encoding configuration item is UTF-8, it will cause the su command to have no response.

Fourth, the problem solution

Know the reason, the solution is simple, I tested, the i18n language item is configured into Chinese, SecureCRT's Character encoding is configured as Default, Vi open the configuration file containing Chinese characters, still garbled, if the configuration of SecureCRT Character encoding to UTF-8 will cause the su command to not work, so I will restore i18n to the default settings:

code is as follows :

LANG=“en_US.UTF-8”

SYSFONT=“latarcyrheb-sun16”

Then configure SecureCRT's Character encoding to UTF-8. Solved the problem of garbled files in the open Chinese characters, and will not let the su command problems, well, just like this! ! !

The above is the unresolved solution for the su command under Linux. This problem mainly occurs in the CentOS 6.3 64-bit system. If you are unfortunate, you can try to solve it by using the method in this article.

Copyright © Windows knowledge All Rights Reserved