第一步:更新软件列表

1
2
3
4
5
6
7
8
9
10
11
12
13
14
zh@ubuntu:~$ sudo apt update
[sudo] password for zh:
Hit:1 http://cn.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,397 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [883 kB]
Fetched 2,615 kB in 10s (271 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
49 packages can be upgraded. Run 'apt list --upgradable' to see them.

第二步:安装vsftpd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
zh@ubuntu:~$ sudo apt install vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ssl-cert
Suggested packages:
openssl-blacklist
The following NEW packages will be installed:
ssl-cert vsftpd
0 upgraded, 2 newly installed, 0 to remove and 49 not upgraded.
Need to get 132 kB of archives.
After this operation, 402 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 ssl-cert all 1.0.39 [17.0 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 vsftpd amd64 3.0.3-12 [115 kB]
Fetched 132 kB in 3s (50.0 kB/s)
Preconfiguring packages ...
Selecting previously unselected package ssl-cert.
(Reading database ... 71512 files and directories currently installed.)
Preparing to unpack .../ssl-cert_1.0.39_all.deb ...
Unpacking ssl-cert (1.0.39)
Selecting previously unselected package vsftpd..............................................................................]
Preparing to unpack .../vsftpd_3.0.3-12_amd64.deb ...
Unpacking vsftpd (3.0.3-12) ...######################.......................................................................]
Setting up ssl-cert (1.0.39) ...#################################...........................................................]
Progress: [ 56%] [##########################################################................................................]
Setting up vsftpd (3.0.3-12) ...########################################################....................................]
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /lib/systemd/system/vsftpd.service.............]
Processing triggers for man-db (2.9.1-1)
Processing triggers for systemd (245.4-4ubuntu3.11) ...

第三步:添加用户

1
2
3
4
5
6
zh@ubuntu:~$ sudo nano /etc/vsftpd.conf
zh@ubuntu:~$ sudo useradd -m ftpuser
zh@ubuntu:~$ sudo passwd ftpuser
New password:
Retype new password:
passwd: password updated successfully

第四步:测试

1
root@ubuntu:/home/zh# echo "TEST" > ../ftpuser/test.txt

G9PfZv.png

评论