---
title: "开启 SSH服务，及FTP 工具 乱码问题"
author: "rainyear"
date: "2012-12-14T02:53:22Z"
tags: []
categories: ["非技术"]
slug: "ssh-ftp"
draft: false
lastmod: "2012-12-14T03:08:43Z"
id: 1747511
url: "https://rainyear.iteye.com/blog/1747511"
---

解决SSH Secure Shell Client中文乱码问题  

sudo apt-get install openssh-server

Ubuntu缺省安装了openssh-client,所以在这里就不安装了，如果你的系统没有安装的话，再用apt-get安装上即可。

然后确认sshserver是否启动了：

ps -e |grep ssh

如果只有ssh-agent那ssh-server还没有启动，需要/etc/init.d/ssh start，如果看到sshd那说明ssh-server已经启动了。

一直使用SSH Secure Shell Client，该软件是免费的SSH远程登录软件。缺点是使用本地编码，比如windows是GBK，那么登录就是通过GBK连接，这样如果服务器编码是UTF-8，会产生中文乱码，比如：

[![ssh.encoding1](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding1-thumb.png)](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding1.png)

 

当需要阅读中文信息的时候就很麻烦。因为现在越来越多的软件或者类库使用通用的UTF-8编码。

目前使用的替代方案是，使用putty：

> [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)

该工具是开源免费的，虽然比SSH Secure Shell Client简陋，但是支持设置编码，而且很小，可以放在U盘中随时使用。

如果不设置编码，默认是系统本地编码，在vista下就是GB18030，设置界面如下：

[![ssh.encoding3](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding3-thumb.png)](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding3.png)

设置后，就可以显示utf-8编码的中文信息了：

[![ssh.encoding2](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding2-thumb.png)](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding2.png)

另外，就是SSH Secure Shell Client支持图形化的SFTP，用于文件的上传和下载，这个功能比较有用，putty只提供了一个命令行的sftp客户端。

可以使用另外的工具实现图形化sftp，比如filezilla，下载地址：

> [http://filezilla-project.org/download.php?type=client](http://filezilla-project.org/download.php?type=client)

下载客户端即可，filezilla还提供了ftp的服务器端。可以下载绿色版本的，或者下载按照官方推荐的windows安装版。该工具的截图：

[![ssh.encoding4](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding4-thumb.png)](http://marshal.easymorse.com/wp-content/uploads/2009/06/sshencoding4.png)

来源：http://blog.sina.com.cn/s/blog\_4f18c3ec0100f9u9.html

不过，我使用发现，用filezilla连接ftp服务器时，中文文件夹，还是显示为乱码，我改用[WinSCP](http://winscp.net/eng/index.php)中文支持很好，能很好的解决了问题。