使用 FileZilla 以图形界面连接 SFTP 服务器
FileZilla SFTP
![](/data/attachment/album/202203/29/164256iljy9w3n053qv28x.jpg)


如果你问那些极客系统管理员，他们会肯定的说使用 [rsync 或者 scp 命令在远程服务器和本地系统之间传输文件](https://linuxhandbook.com/transfer-files-ssh/)。


然而，这些都是命令行方式，并不是每个人都能用起来感到舒适。


谢天谢地的是，有一些图形化工具能够让你从远程服务器来传输文件。


[FileZilla](https://filezilla-project.org/) 是一个流行的、跨平台的传输文件为目的开源软件。它支持使用通过 TLS 或者 SSL 加密的 FTP 协议（FTPS），也支持借助 SSH 的 FTP 协议，以及旧的 FTP 协议。


让我展示怎样在 Linux 上安装 FileZilla 然后用它来文件传输。


那么，让我们开始吧！


### 在 Ubuntu 和其他 Linux 发行版上安装 FileZilla


你可以使用源码来安装，但是还是建议使用你的发行版提供的软件包。因为它是一个热门软件，它应该在许多 Linux 发行版（即便不是全部）的软件仓库中可用。请使用你的发行版的软件中心和包管理器来安装。


在 Ubuntu 上，你可以从软件中心来安装它：


![FileZilla is available in the Ubuntu Software Center](/data/attachment/album/202203/29/164448dl5ia3c5i0evieec.png)


你也可以使用命令行的方式来安装它：



```
sudo apt install filezilla

```

如果你看到 [软件包不存在的错误](https://itsfoss.com/unable-to-locate-package-error-ubuntu/)，你应该 [开启 Universe 仓库](https://itsfoss.com/ubuntu-repositories/)。


一旦安装成功，打开菜单（通过按 `Super` 键），键入 “FileZilla”来启动它。


![Start FileZilla from the system menu](/data/attachment/album/202203/29/164448oett2yir7y5p7bts.png)


### 使用 FileZilla


第一次使用 FileZilla 时，你将会看到如下图所示的一个界面：


![Screenshot of FileZilla running](/data/attachment/album/202203/29/164450bcy3caqw2yo6ngwf.png)


左边窗口显示来自你本地系统的文件和目录。右边窗口显示目前是空的。当你连接到远程服务器时，来自你的远程系统的文件会显示在这里。


在我向你展示之前，让我分享一下关于理解 FileZilla 图形界面重要方面的一些细节。


#### 了解 FileZilla 图形界面


下图总体上给你展示了 FileZilla 窗口布局的不同部分。


![FileZilla Window Layout | image credit](/data/attachment/album/202203/29/164451bqqfb2x1shqs3jss.jpg)


图形界面由 6 个不同的区域/窗口来组成。让我简短的给你解释一下：


**1、工具栏**：它有许多选项，如打开站点管理器、刷新本地和远程目录文件和文件列表、开始处理当前的文件传输队列、停止正在传输的任务并取消队列中的文件，等等。


**2、快速连接栏**：顾名思义，它允许你快速连接到一个远程站点，除了主机名、用户名、密码和端口之外，不需要指定更多细节。


**3、消息日志**：它显示了一个日志，不论你连接成功与否。错误消息标记为红色，正常消息为白色，命令是蓝色。


**4 & 5、本地窗口和远程窗口**：这两个窗口非常相似，除了本地窗口显示本地目录内容，并且有用来上传文件的上下文菜单；而远程窗口显示的是远程目录的内容，并有从远程目录下载到本地文件的选项。


**6、传输队列**：最后，传输队列窗口显示正在传输的项目的状态和它们的传输速度，以及队列中的文件和传输历史（仅限当前实例）。


#### 使用 FileZilla 连接到 SFTP 服务器


你需要知道远程服务器的用户名、密码和 IP 地址。远程服务器也应该被设置成能够接受以这些信息进行的连接。你还需要在目标文件夹有正确的权限设置。


要新增一个 SFTP 连接，你需要打开站点管理器。有两种方式可以打开它。


在菜单栏上的“<ruby> 文件 <rt>  Files </rt></ruby>”菜单选项下有一个“<ruby> 站点管理器 <rt>  Site Manager </rt></ruby>”。或者，你可以直接点击工具栏上的“站点管理器”图标。


![the Site Manager button on the toolbar](/data/attachment/album/202203/29/164452vpqq66ah6f0qi5qa.jpg)


一旦站点管理器对话框弹出，点击“<ruby> 新站点 <rt>  New site </rt></ruby>”按钮，并（可选地）重命名添加到条目中的新站点。我叫我的站点为“test8”。


![screenshot of the Site Manager](/data/attachment/album/202203/29/164453r9k699r8xw8pp9rx.png)


在右侧的“<ruby> 常规 <rt>  General </rt></ruby>”标签下，确保所使用的协议与服务器管理员为你设置的相一致。在我的例子中，我设置了一个 SFTP 服务器（<ruby> 借助 SSH 通道的 FTP <rt>  FTP over SSH </rt></ruby>），因此我选择了“<ruby> SFTP - SSH 文件传输协议 <rt>  SFTP – SSH File Transfer Protocol </rt></ruby>”。


下一个字段填写远程服务器的 IP 地址。


如果你没有设置“<ruby> 端口号 <rt>  Port </rt></ruby>”，FileZilla 将假定要使用的端口号为缺省的 SSH 协议的 22 端口。


“<ruby> 登录类型 <rt>  Logon Type </rt></ruby>”下拉列表有几个选项。在“<ruby> 常规 <rt>  Normal </rt></ruby>”登录方式下，你只需要提供用户名和密码。


如果你设置了一对公钥和私钥来验证你的 SSH 用户连接，那么可以使用“<ruby> 密钥文件授权 <rt>  Key file authentication </rt></ruby>”方式。


一旦你为远程服务器和认证填写了所有适当的细节，就可以点击底部的“<ruby> 连接 <rt>  Connect </rt></ruby>”按钮连接到站点。别担心，你刚刚建立连接的新站点将会按“登录类型”保存起来。


![Remote pane being populated after a successful connection](/data/attachment/album/202203/29/164454z53irwvnbnvx4dit.png)


如果你看到一个 “连接到 <主机 IP 地址>” 的状态消息，并且最近的状态消息是 “目录列表 "/" 显示成功”，说明你已经成功的连接到了远程的 SFTP 服务器（使用 SSH 协议的 FTP）。


另一个 SFTP 连接成功的标志是，当连接成功建立的时候，远程目录窗口有了很多消息。


#### 发送文件到远程系统


你必须 **确保你位于要传输文件的目录里**。传输文件非常简单，只需**双击文件**，无需指定指定目标位置。


如果你在左边窗口双击了一个文件，它立即传输到右边科技的目录里（或者有传输任务的话，加到队列中）。


同样，从右边窗口到左边窗口也是一样双击，即从远程服务器到本地。**这就是为什么本地和远程系统都要在正确的位置是非常重要的原因**。


此外，你也可以鼠标右击文件上传它们（或者加它们到上传队列）。目标位置总是 FileZilla 界面中显示的目录。


![Transfer queue pane showing the local file name, remote destination, transfer speed and an ETA](/data/attachment/album/202203/29/164456xx781je8qq158gog.png)


除了方便和快捷方面，这两种上传的文件方式没有什么不同。


#### 下载远程系统中的文件


像上传文件一样，当从远程服务器传输文件到本地时也有两种方式，但不是“上传”而是“下载”。


下载的文件将放在本地目录窗口中，也就是你当前打开的本地窗口。


你将会注意到除了发送方和接收方不同之外，下载和上传文件的行为是一样的。除非连接数受到限制，否则文件传输将是并行进行的。


### 总结


厉害！有了这些基础知识，你应该能够在你的计算机和服务器之间传输文件。我希望你能够学到一些新东西 : )


如果你感到这些对你有帮助，随意在评论部分留下你的问题、建议或简单的一句 “thank you”。




---


via: <https://itsfoss.com/filezilla-ubuntu/>


作者：[Pratham Patel](https://itsfoss.com/author/pratham/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[hwlife](https://github.com/hwlife) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

If you ask the geeky sysadmins, they will swear by [rsync or scp commands for transferring files between remote server and local system](https://linuxhandbook.com/transfer-files-ssh/?ref=itsfoss.com).

However, those are command line methods and not everyone feels comfortable.

Thankfully, there are some GUI tools available that let you transfer files to or from the remote servers.

[FileZilla](https://filezilla-project.org/?ref=itsfoss.com) is a popular, cross-platform, open-source tool for this purpose. It supports transferring file using FTP over TLS or SSL (FTPS) and also FTP over SSH (SFTP) along with old FTP protocol.

Let me show how to install FileZilla on Linux and then use it for file transfer.

So, let’s get started!

## Installing FileZilla on Ubuntu and other Linux distributions

You can get the source code tarball but it is always recommended to use your distribution provided package. Since it is a popular software, it should be available in the software repository of most Linux distributions (if not all). ** Please use your distribution’s software center and package manager**.

On Ubuntu, you can install it from the software center:

![filezilla ubuntu software center](https://itsfoss.com/content/images/wordpress/2022/03/filezilla-ubuntu-software-center.png)

You can also use the command line method to install it.

`sudo apt install filezilla`


If you see the [package not found error](https://itsfoss.com/unable-to-locate-package-error-ubuntu/), you should [enable the Universe repository](https://itsfoss.com/ubuntu-repositories/).

Once installed, go to the menu (by pressing the windows key), type FileZilla and start it.

![filezilla ubuntu](https://itsfoss.com/content/images/wordpress/2022/03/filezilla-ubuntu.png)

## Using FileZilla

When you first run FileZilla, you’ll see an interface like the picture below.

![01 filezilla](https://itsfoss.com/content/images/wordpress/2022/01/01_filezilla-800x431.webp)

The left side pane shows the files and directory from your local system. The right side pane is empty for now. When you connect to a remote server, the files from your remote system will be displayed there.

Before I show you that, let me share a few details on understanding the important aspects of FileZilla interface.

### Understaing the FileZilla interface

The image below give you an overview of the different sections of the window layout of FileZilla.

![02 filezilla layout](https://itsfoss.com/content/images/wordpress/2022/01/02_filezilla_layout-800x504.webp)

[image credit](https://wiki.filezilla-project.org/File:Annotated_main_window.png?ref=itsfoss.com)

The GUI is split in 6 different zones/window layout. Let me briefly explain them to you.

**1. Toolbar:** It has a variety of options like opening the Site Manager, refreshing local and/or remote directory file and folder lists, start processing current queue of files to be transferred, stop all transfers and discard files from queue, etc.

**2. The Quick connect bar:** As its name suggests, allows you to quickly connect to a remote site without specifying many details about it except the host, username, password and port.

**3. The Message log:** It shows you a log, regardless if the connection was successful or not. The errors are in red, normal messages are in white, and commands are in blue.

**4 & 5. The Local pane and remote panes**: Both are very similar except for the fact that the Local pane shows contents of a local directory and a context menu has options for uploading files. Whereas, the remote pane shows contents of a remote directory and has options for downloading files from a remote directory to your local storage.

**6. Transfer queue**: Lastly, the Transfer queue pane shows the status of items being transferred, their transfer speeds, items in queue and the file transfer history (limited to current instance

### Connecting to a SFTP server using FileZilla

*You need to know the username, password and the IP address of the remote server. The remote server should also be configured to accept connections with the provided details. You also need to have correct access settings in the destination folder.*

To add a new SFTP connection, you need to open the site manager. There are two ways to open it.

There is a “Site Manager” item under the “Files” menu option on the menu bar. Or, you can click on the “Site manager” icon on the toolbar.

![03 site manager annotated](https://itsfoss.com/content/images/wordpress/2022/01/03_site_manager_annotated.webp)

Once the Site Manager dialog pops up, click on the “New site” button and [optionally] rename the new site that is added to the entry. I have called mine “test8”.

![04 site manager](https://itsfoss.com/content/images/wordpress/2022/01/04_site_manager-800x577.webp)

To the right, under the General tab, ensure that the protocol used is appropriate to what the server administer has set for you. In my case, I set up a SFTP server (FTP over SSH) so I will proceed by choosing the option “SFTP – SSH File Transfer Protocol”.

The next field is for the IP address of the remote server.

If you do not mention the port number, FileZilla will assume that the port number to be used is the default SSH port 22.

There are a few options for the “Logon Type” drop-down. In the Normal logon method, you provide the username and password.

The Key file authentication method is useful for you if you have a pair of public and private keys set up to authenticate your SSH connection for the user.

Once you have filled all the appropriate details for the remote server and authentication, click on the “Connect” button positioned at the bottom to connect to the site. Do not worry, the new site you just established a connection to, will be saved in compliance to the “Logon Type”.

![05 successful connection](https://itsfoss.com/content/images/wordpress/2022/01/05_successful_connection-800x431.webp)

If you see a status message as “Connected to <host IP address>” and the most recent status message as “Directory listing of “/” was successful”, you have successfully connected to the remote SFTP server (FTP using the SSH protocol).

Another indicator of a successful SFTP connection is that the remote directory pane gets populated when a connection is successfully established.

### Sending files to remote system

You must **make sure to be in the directories where you have to transfer the file**. Transferring files is as simple as **double-clicking on the file** without explicitly specifying the target location.

If you click on a file from the left pane, it immediately gets transferred (or added to the queue if there are pending transfers) to the directory visible in the right pane.

The same goes from transferring files from right to left, i.e., from remote server to local. **This is why it is important to be in the correct locations in both local and remote systems**.

Alternatively, you can right-click on the file(s) and upload them (or add them to the upload queue). The destination is always the directory displayed in FileZilla interface.

![07 transfer pane populated 1](https://itsfoss.com/content/images/wordpress/2022/01/07_transfer_pane_populated-1-800x431.webp)

There isn’t much difference in either way of uploading files except for convenience and timing.

### Downloading files from remote system

Just like uploading files, you get two options when transferring file from a remote server to local storage, but instead of “Upload” it is “Download”.

Downloading a file will download that file in the local directory that you currently have open in the Local directory pane.

You will notice a consistent behavior in downloading and uploading files, except for the sender and receiver. The file transfers will be in done in parallel unless the number of connections is restricted.

## Conclusion

Awesome! With the basics covered, you should be able to transfer files to and from your computer to your server. I hope you learnt something new :)

If you have any queries, please ask them in the [It’s FOSS community forums](https://itsfoss.community/?ref=itsfoss.com). If you felt this was helpful to you, do let me know with a comment down below!