学习目录:FTP NFS SSH
FTP 文件传输协议
1、安装vsftpd
[root@izuf6b2csqaz54wz7ifreiz ~]# yum install vsftpd
FTP服务器主目录:"/var/ftp/",是FTP程序分享内容的本机目录。
2、启动vsftpd并加入开机启动
[root@izuf6b2csqaz54wz7ifreiz ~]# systemctl start vsftpd
[root@izuf6b2csqaz54wz7ifreiz ~]# systemctl enable vsftpd
关闭防火墙:
[root@izuf6b2csqaz54wz7ifreiz ~]# systemctl stop firewalld
3、访问地址
ftp://192.168.48.128/
4、linux中下载FTP中的文件
[root@shukai opt]# wget ftp://192.168.48.128/11.txt
--2021-05-05 15:20:21-- ftp://192.168.48.128/11.txt
=> “11.txt”
正在连接 192.168.48.128:21... 已连接。
正在以 anonymous 登录 ... 登录成功!
==> SYST ... 完成。 ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> 不需要 CWD。
==> SIZE 11.txt ... 完成。
==> PASV ... 完成。 ==> RETR 11.txt ... 完成。
[ <=> ] 0 --.-K/s 用时 0s
2021-05-05 15:20:21 (0.00 B/s) - “11.txt” 已保存 [0]
[root@shukai opt]# ls
11.txt AutoMount ftp list qhc.sh rh tengine-2.3.2 tengine-2.3.2.tar.gz test.js tmpfile
[root@shukai opt]#
5、启动上传功能
①anonymous_enable 使能匿名账号,默认开启
vim /etc/vsftpd/vsftpd.conf
②anon_upload_enable=YES 启动上传文件能力
[root@shukai opt]# vim /etc/vsftpd/vsftpd.conf
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
# 创建上传文件目录,并且进行附加权限
[root@shukai opt]# mkdir /var/ftp/upload
[root@shukai opt]# chmod 777 /var/ftp/upload
开启后重启服务:
[root@shukai opt]# systemctl restart vsftpd