在电脑和安卓设备之间使用 FTP 传输文件
Android 安卓 FTP
![](/data/attachment/album/201610/12/220442i610th12tg6v0tnl.jpg)


每一个使用安卓设备的人都知道可以[使用 USB 线连接电脑来传输文件](https://itsfoss.com/how-to-connect-kindle-fire-hd-with-ubuntu-12-10/)，但是不是所有人都知道可以使用自由开源软件（FOSS 软件）通过无线连接到安卓设备。


我知道，这并非最简易的方式，但这样做的确很有趣而且感觉很极客。所有，如果你有一些 DIY 精神，让我为你展示如何在 Linux 和 安卓设备之间使用 FTP 来传输文件。


### 第一步：安装必要的软件


为了连接你的安卓设备，至少需要：一个 FTP 服务器和一个 FTP 客户端。这两者都有不少的选择，个人比较推荐 [Filezilla](https://filezilla-project.org/) 作为客户端，因为它是开源的，而且支持多种平台。


我最喜欢的 FOSS 安卓应用商店就是 [F-Droid](https://f-droid.org/)。F-Droid 有两个非常棒的 FTP 服务端应用：[primitive ftpd](https://f-droid.org/repository/browse/?fdfilter=ftp&fdid=org.primftpd) 和 [FTP Server (Free)](https://f-droid.org/repository/browse/?fdfilter=ftp&fdid=be.ppareit.swiftp_free)。这两者都只能运行在安卓 4.0 或者更高的版本中。本文我会集中介绍 primitive ftpd，如果使用 FTP Sever (free) 也是一样的步骤。


### 第二步：熟悉 FTP 服务器


安装好 FTP 客户端和服务端之后，就是设置两者之间的连接了。先从安卓设备的 FTP 服务端开始，首先，通过应用启动器打开 primitive ftpd。


![](/data/attachment/album/201610/12/220601zbqp3939fvg3vfvy.png)


打开应用之后，你将看到一大串的数字。不用紧张，你可以看到服务端已经分配到一个 IP 地址 (本文是 192.168.1.131)。往下看，将看到 FTP 和 SFTP 服务 (SFTP 是一个截然不同的协议，它通过 SSH 进行连接) 都是还未运行的。再往下就是用户名，本文设置为 user。


在屏幕顶端有两个按钮，一个用于开启 FTP 服务，另一个则是设置 FTP 服务。启动服务是不言自明的。


![](/data/attachment/album/201610/12/220648gjt8pcacppo4hpz2.png)


在设置菜单中，可以改变服务器的用户名、访问密码以及所使用的端口。并且你可以设置当服务器激活是阻止待机、服务开机自启或者变更主题。


![](/data/attachment/album/201610/12/220813e3m30h4pp10p0fez.png)


![](/data/attachment/album/201610/12/220836q4xyrx7rcu437wz7.png)


![](/data/attachment/album/201610/12/220948xo4rwyb49r448go2.png)


### 第三步：使用 Filezilla


现在打开对应你所用系统的 Filezilla。使用 Filezilla 有两种方法：在需要传输文件时输入 IP、用户名、密码和端口，或者在 Filezilla 中预先保存这些信息（值得注意的是：基本上，每次你打开 FTP 服务时，IP 都会不同的，所用需要更新保存在 Filezilla 中信息）。我会展示这两种方法。


如果你想要手动输入，直接在 Filezilla 窗口上方输入必要的信息然后点击“快速连接”即可。


![](/data/attachment/album/201610/12/221013nuwujiff710hazz5.png)


需要预先存储信息的话，点击文件菜单下方的按钮，这会打开“站点管理器”对话框，填写你想要保存的信息即可。通常，我设置“登录类型”为“询问密码”，安全为上。如果使用的是 FTP，保存默认选项即可；但如果使用的是 SFTP，必须在协议下拉选项框中进行协议的选择。


![](/data/attachment/album/201610/12/221030pfgjfuyfagniayiu.png)


点击连接，输入密码即可。你会看到一个连接新主机的警告，这是可以在此验证屏幕上显示的“指纹信息”是否与 Primitive FTPD 上的一致。如果一致 (也应该是一致的)，点击确认添加都已知主机列表，之后就不会出现该警告了。


![](/data/attachment/album/201610/12/221050m8zrrfpopjzpbvj5.png)


### 第四步：传输文件


现在，你会看到两个框，一个是“本地站点”，一个是“远程站点”，对应的呈现了你电脑和安装设备上的目录和文件信息。然后你就可以在电脑端浏览和传输文件到你的安卓设备上了。个人建议上传文件到你的 Download 文件夹，以便于文件跟踪管理。你可以右击某个文件，在弹出的菜单中选择上传或者下载以及移动操作，或者简单双击也行。


![](/data/attachment/album/201610/12/221116lwkbwppsixskfyzy.png)


### 第五步：停止服务


当你完成文件的传输之后，你需要做得就是停止安卓设备上的 FTP 服务和关闭 Filezilla，如此简单，不是吗？


### 结论


我相信会有人指出，FTP 并不安全。而我认为，本例不需要考虑这个问题，因为连接时间一般很短。并且多数情况下，都是在家庭私有网络环境中进行操作。


这就是我在 Linux 和安卓设备间最喜欢使用的方法。


觉得有用吗？或有又没觉得推荐的相似软件？请在评论中告诉我们。


如果觉得此文有用，请花几分钟分享到你常用的社交站点中。




---


via: <https://itsfoss.com/use-ftp-linux-android/>


作者：[John Paul](https://itsfoss.com/author/john/) 译者：[GHLandy](https://github.com/GHLandy) 校对：[wxy](https://github.com/wxy)


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


OK
Everyone who has an Android device knows that you can [transfer files by plugging it into your computer with a USB cable](https://itsfoss.com/how-to-connect-kindle-fire-hd-with-ubuntu-12-10/). Not everyone knows that you can use FOSS software to connect to your Android devices wirelessly.

I know that it’s not the easiest method out there, but this is a fun and geeky way to do it. So if you are in some DIY mood, let me show you * how to transfer files between Linux and Android using FTP*.

## Transfer Files between Android and Linux using FTP

So here’s the step by step process of setting up FTP for transferring files between Linux desktop and Android smartphone.

### Step 1: Get the Necessary Software

In order to connect to your Android device, you need two things: an FTP server and an FTP client. There are quite a few of both to choose from. I would recommend [Filezilla](https://filezilla-project.org/) as an FTP client because it is open-source and available on multiple platforms.

My favorite FOSS app store for Android is [F-Droid](https://f-droid.org/). F-Droid has two great FTP server apps: [primitive ftpd](https://f-droid.org/en/packages/org.primftpd/) and [FTP Server (Free)](https://f-droid.org/repository/browse/?fdfilter=ftp&fdid=be.ppareit.swiftp_free). Both require Android 4.0 or newer. I will focus on primitive ftpd in this article, but similar steps can be used for FTP Sever (Free).

### Step 2: Getting Familiar with the FTP Server

Once you have both the FTP client and server installed, It’s time to set up the connection between the two. Let’s start with the FTP server on the Android device. First, open primitive ftpd from your app drawer.

Once the app opens, you’ll be confronted by a bunch of numbers. Don’t freak out. You’ll see that server has assigned an IP address (in this test case 192.168.1.131). If you look down further, you will see that both FTP and SFTP are currently not running (SFTP is a slightly different protocol that uses SSH to connect.). Below you can see the username, which is currently set to user.

At the top of the screen, there two buttons. One will start the FTP server and the other will take you to settings. Starting the server is self-explanatory.

In the setting menu, you can change the server’s username, password and which port the server uses. You can also prevent standby while the server is active, set the server to start on boot or change the theme.

![android-2-2](https://itsfoss.com/content/images/wordpress/2016/09/android-2.2-169x300.png)

![android-3](https://itsfoss.com/content/images/wordpress/2016/09/android-3-169x300.png)

![android-5](https://itsfoss.com/content/images/wordpress/2016/09/android-5-169x300.png)

### Step 3: Using FileZilla

Now open FileZilla on your system of choice. You have two options on how you use Filezilla. You can either manually type in the IP address, username, password, and port every time you want to move a file or you can store that information on Filezilla. (Note: Every time you start the FTP server the IP address will be different, so you will have to update the number saved on Filezilla.) I will show you both ways.

If you want to do it manually, merely fill in the required spaced at the top of the FileZilla window and hit “quick connect”.

![filezilla-1-2](https://itsfoss.com/content/images/wordpress/2016/09/filezilla-1.2.png)

To save the information, click on the icon below the file menu. This will open the Site Manager dialog box. Fill out the information you want to save. I usually set “login type” to “ask for password” top be a little bit more secure. If you are going to use FTP, you can leave the default, but if you want to use SFTP you have to select it from the Protocol dropdown box.

![filezilla-2](https://itsfoss.com/content/images/wordpress/2016/09/filezilla-2.png)

Click connect, enter your password and you are in. You will see a warning that you are connecting to a new host. You can verify the fingerprint on the screen against what primitive ftpd says. If it’s correct (and it should be) select the box to add it to the cache, so you don’t see this message in the future.

![filezilla-5](https://itsfoss.com/content/images/wordpress/2016/09/filezilla-5.png)

### Step 4: Moving Files

Now you’ll see an address box that says “local site” and another that says “remote site”. Those represent your computer and your Android device respectively. From here you can browse through your PC and move files to your Android device. I would recommend uploading files into your Downloads folder so you can keep track of them easier. You can either right-click on a file and select upload or download from the popup menu to move it or you can just double click on it.

![filezilla-6](https://itsfoss.com/content/images/wordpress/2016/09/filezilla-6.png)

### Step 5: Closing up Shop

When you are done moving files, all you have to do is stop the FTP server on your Android device and close down Filezilla. As easy as that.

**Conclusion**

I’m sure that several people will point out that FTP isn’t really very secure. I think that this use case is different because the connection will be very short and in most cases, people will do it in the privacy of their own homes.

This is my favorite method of moving files between Linux and Android.

Did you find it helpful? Do you have any suggesting for similar programs? Let us know below in the comments.

If you found this article interesting, please take a minute to share it on your favorite social media sites.