Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of non-response of su command under Linux

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to solve the problem of unresponsive su command under Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem of unresponsive su commands under Linux.

I. the environment in which the problem arises

CentOS 6.3 X64

SecureCRT 7.0.0 English version

Second, the specific description of the problem

Today, when I was operating one of my own Linux servers, suddenly the su command did not work. After typing the command enter, there was no response, whether it was su or su -. The problem remains the same after restarting the system.

The most patient one waited for more than 1 minute, and su appeared: the character behind it was a hint of garbled code. There was no screenshot at that time, and now I don't want to restore the problem. Let's talk about the cause and solution of the problem.

Third, the cause of the problem

After being depressed for a long time, I remembered that the last action before logging out was to change the character encoding setting in SecureCRT and set the path:

The code is as follows:

Options > Session Options > Terminal > Appearance > Character encoding > set from default to UTF-8

As shown in the following figure:

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

The problem is to remember that there is no problem with this setting before reinstalling the system, that is, it will not cause the su command to fail to respond. It is very strange. After thinking about it carefully, it seems that the i18n configuration of CentOS has been modified a few days ago, and the current i18n configuration.

The code is as follows:

# LANG= "en_US.UTF-8"

# SYSFONT= "latarcyrheb-sun16"

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 that time was also to solve the garbled problem. Combined with the current problem, I imagined the possible cause of the problem, and then tested it, and it was exactly the same as expected.

Summary of the reason: when the i18n language is configured in Chinese and the Character encoding configuration item of SecureCRT is UTF-8, it will result in no response to the su command.

IV. Solution to the problem

Knowing the reason, it is easy to solve. I have tested that when the i18n language entry is configured to Chinese, and the Character encoding of SecureCRT is configured as Default, vi opens the configuration file containing Chinese characters, and there will still be garbled codes. If the Character encoding of SecureCRT is configured as UTF-8, the su command will not work, so I restore i18n to the default setting:

The code is as follows:

LANG= "en_US.UTF-8"

SYSFONT= "latarcyrheb-sun16"

Then configuring the Character encoding of SecureCRT to UTF-8 perfectly solves the problem of garbled Chinese characters in vi opening, and won't let the su command go wrong. All right, that's it!

At this point, I believe you have a deeper understanding of "how to solve the problem of unresponsive su commands under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report