SSH encoding
?? Today to discuss the SSH connection process, the local host and the remote host character set does not match when the problem of avoiding Chinese garbled.
Conventions
| system |
Host name |
Character Set |
| CentOS Linux Release 7.0.1406 |
Centsos |
Gbk |
| Linux Mint 18.0 LTS |
Qwfys |
Utf-8 |
No parameter scenario
[email protected] ~ $ SSH [email protected]last Login:sat May 5 14:31:12 2018 from 112.10.209.123Welcome to Al Iyun Elastic Compute service! [[email protected] ~]# localelang=zh_cn.gbklc_ctype= "ZH_CN.GBK" LC_NUMERIC=ZH_CN. Utf-8lc_time= "ZH_CN.GBK" lc_collate= "ZH_CN.GBK" LC_MONETARY=ZH_CN. Utf-8lc_messages= "ZH_CN.GBK" LC_PAPER=ZH_CN. Utf-8lc_name=zh_cn. Utf-8lc_address=zh_cn. Utf-8lc_telephone=zh_cn. Utf-8lc_measurement=zh_cn. Utf-8lc_identification=zh_cn. Utf-8lc_all=[[email protected] ~]# [[email protected] ~]# Java-versionjava Version "1.8.0_161" Java (TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot (TM) 64-bit Server VM (build 25.161-b12, Mixed mode) [[Email pro Tected] ~]# Java:java [-options] class [args ...] (?) java [-options]-jar jarfile [args ...] (? jar)?:-d32? 32λ ()-d64? 64λ ()-server? "Server" VM? VM server,? -CP <?? Zip/jar >-classpath <??Zip/jar >:???, jar ZIP,-d<>=<?>?? -VERBOSE:[CLASS|GC|JNI]? -version Fen-version:<?>:??, δ??? Fen-showversion Fen-jre-restrict-search | -no-jre-restrict-search:??, δ Fen/? JRE-? -help? X?? -ea[:<packagename>...|:<classname>]-enableassertions[:<packagename>...|:<classname>] ?? -da[:<packagename>...|:<classname>]-disableassertions[:<packagename>...|:<classname>] ?? -esa | -enablesystemassertions?? -DSA | -disablesystemassertions?? -agentlib:<libname>[=<?>]? <libname>,-agentlib:hprof-agentlib:jdwp=help-agentlib:hprof=help-agentpath:<pathname>[=<?>]? -javaagent:<jarpath>[=<?>] Java, java.lang.instrument-splash:<imagepath> ?????, http://www.oracle.com/technetwork/java/javase/documentation/index.html[[email protected] ~]# Exit?C Onnection to Centsos closed. [email protected] ~ $
With parametric scene
[email protected] ~ $ luit-encoding GBK ssh [email protected]last Login:sat May 5 14:34:06 2018 from 112.10.2 09.123Welcome to Aliyun Elastic Compute service! [[email protected] ~]# java usage: Java [-options] class [args ...] (execution Class) or Java [-options]-jar jarfile [args ...] (Execute JAR file) options include:-d32 use the 32-bit data model (if available)-D64 use the 64-bit data model (if available)-server Select the "Server" VM The default VM is server because you are running on a server class computer. -CP < directory and Zip/jar file class search path >-classpath < directory and Zip/jar file class search path > with: Delimited directory, jar archive And a list of ZIP archives to search for class files. -d< name >=< value > Set system Properties-verbose:[class|gc|jni] enable verbose output-version output product version and Exit-version:< value > Warning: This feature is obsolete and will be removed in a future release. The specified version is required to run the-showversion output product version and Continue-jre-restrict-search | -no-jre-restrict-search Warning: This feature is obsolete and will be Removed in future releases. Include/exclude user-specific JRE in version search-? -help output This Help message-X output non-standard option help-ea[:<packagename>...|:<classname>]-enableassertions[:&l T;packagename>...|:<classname>] Enable assertion-da[:<packagename>...|:<classname> by the specified granularity;] -disableassertions[:<packagename>...|:<classname>] Disables assertion with the specified granularity-esa | -enablesystemassertions Enable System Assertion-DSA | -disablesystemassertions Disable system assertion-agentlib:<libname>[=< option;] Load Native Agent library <li Bname>, for example-agentlib:hprof see also-agentlib:jdwp=help and-agentlib:hprof=help-agentpath:<pathname& Gt [=<;] Load the native agent library by full pathname-javaagent:<jarpath>[=< option;] Loading the Java programming language proxy, please See java.lang.instrument-splash:<imagepath> using the specified image to display the splash screen For more information, see HTTP://WWW.ORACLE.COM/TECHN Etwork/java/javase/documentation/index.html. [[EMAIl protected] ~]# exit logout connection to Centsos closed.
Summary
You can use the following command with SSH.
[email protected] ~ $ luit -encoding 字符集 ssh 用户名@远程主机
Reference documents
- IBM Knowledge Center/meaix 7.2/luit command
Linux Combat/SSH