Practical Tips: Solve the Chinese problems of Samba and Shell

Source: Internet
Author: User
Article Title: Practical Tips: Solve the Chinese problems of Samba and Shell. Linux is a technology channel of the IT lab in China. Some basic classification Linux servers, such as desktop applications, Linux system management, kernel research, embedded systems, and open source, sometimes have the following problems:
 
(1) files uploaded through samba may sometimes fail to be displayed in ftp or shell.
 
(2) At the same time, files uploaded through ftp cannot be normally displayed in samba. Why?
 
The reason is that their character set is different.
 
Solution:
 
Step 1: Check whether the shell language is Chinese.
 
Echo $ LANG
 
If it is displayed as zh_CN. *****, there is basically no problem. You can skip this step. If it is en_US. *****, you must change it to Chinese by setting it in/etc/sysconfig/i18n.
 
LANG = "zh_CN.GBK", LANG = "zh_CN.GB2312", LANG = "zh_CN.GB18030" or LANG = "zh_CN.UTF-8"
 
Or you can directly use export LANG = zh_CN.GBK. For more information, see the linux settings.
 
Step 2 is also the most critical step. It is to change the smb. conf settings: add the code in the [global] domain
 
  
     
      shell charset= cp936display charset= cp936dos charset= cp936unix charset= cp936client code page = 936character set = 936
     


In this way, the samba file name created under shell can be seen normally, and the shell file name created by samba can also be displayed normally. Most ftp does not have its own character set conversion system, and shell is used.
 
Therefore, you do not need to set this parameter unless necessary.
 

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.