1.FTP服务
# FTP 服务是什么

# 1. 安装vsftpd软件包
[root@stream9 ~]# yum -y install vsftpd

[root@stream9 ~]# systemctl start vsftpd
[root@stream9 ~]#
[root@stream9 ~]# systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
[root@stream9 ~]#
[root@stream9 ~]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemon
     Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; preset: disabled)
     Active: active (running) since Sat 2023-11-04 00:42:07 CST; 17s ago
   Main PID: 1719 (vsftpd)
      Tasks: 1 (limit: 11125)
     Memory: 720.0K
        CPU: 5ms
     CGroup: /system.slice/vsftpd.service
             └─1719 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

Nov 04 00:42:07 stream9 systemd[1]: Starting Vsftpd ftp daemon...
Nov 04 00:42:07 stream9 systemd[1]: Started Vsftpd ftp daemon.

# 2. 配置文件
[root@stream9 ~]# grep -Ev "^#|^$" /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES

# 默认端口是21,就像nginx/httpd 是80, tomcat 是8080,mysql是3306一样
# 查端口,就用这个命令
[root@stream9 ~]# netstat -antulp | grep ftp
tcp6       0      0 :::21                   :::*                    LISTEN      1719/vsftpd


# 3. FTP默认共享路径:/var/ftp
[root@stream9 pub]# pwd
/var/ftp/pub
[root@stream9 pub]# ls
1.txt  2.txt  passwd

# 4. 从 kvm 中访问 ftp 虚拟机的ftp服务
[root@kvm ~]# firefox ftp://10.10.10.200