Scenario Description
After connecting to assets through JumpServer, we may encounter garbled content in the command execution results from the target asset. This is usually caused by a mismatch in encoding between the JumpServer platform and the target asset. This article will explain the solution for garbled output in this scenario.
Configuration Description
Check Charset
JumpServer
The Charset option in JumpServer is set through Platforms. For example, in Linux, the default Charset is UTF-8.
Open the JumpServer Console page, select <Platforms>, and click the name of the <Linux> Platform, where you can see the <Charset> is set to <UTF-8>.
Linux
To check the Charset in Linux, you can enter the command <echo $LANG> on the server.
Change Charset
JumpServer
When the encoding of JumpServer and the target asset is inconsistent, garbled characters may appear. Here, we will explain how to modify the encoding for both JumpServer and the target asset.
Open the JumpServer Console page, select <Platforms>, Create a new <Linux> Platform, and you can choose the configuration in the <Charset> field.
Switch to the <Assets> module, and in the update page of the target asset, configure the <Platform> field to the newly created encoding platform.
After the configuration is complete, when reconnecting to the asset through JumpServer, the encoding from the platform will be used for operations.
Linux
Edit the < /etc/profile > file to globally modify the encoding of the Linux server.
$ vim /etc/profile
# Add the following configuration at the end of the file:
export LC_ALL="zh_CN.UTF-8"
export LANG="zh_CN.UTF-8"
Run the command < source /etc/profile > to apply the configuration.