当前位置 博文首页 > m0_53521757的博客:Linux(CentOS7)之FTP服务器设置
FTP:文件传输协议
匿名访问模式:
FTP匿名访问模式是比较不安全的服务模式,尤其在真实的工作
环境中千万不要存放敏感的数据,以免泄露。
vsftpd程序默认已经允许匿名访问模式,我们要做的就是开启
匿名用户的上传和写入权限,在配置文件/etc/vsftpd/vsftpd.conf
写入下面的参数:
参数 | 作用 |
---|---|
anonymous_ enable=YES | 允许匿名访问模式 |
实验环境
主机类型 | 操作系统 | IP地址 |
---|---|---|
服务端 | CentOS7 | 192.168.11.38 |
客户端 | CentOS7 / Windows10 | ------ |
1.安装vsftpd服务程序包
[root@localhost ~]# yum -y install vsftpd
2.编辑配置文件,添加内容
[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf
anon umask=022
anon_ upload_ enable=YES
anon_ mkdir write_ enable=YES
anon_ other write_ enable=YES
3.启动服务器
[root@localhost ~]# systemctl start vsftpd
[root@localhost ~]# systemctl enable vsftpd
4.关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
5.关闭SELinux
[root@localhost ~]# setenforce 0
6.客户机( windows )登录FTP服务
匿名访问模式的FTP根目录为/var/ftp
可以先在服务端的/var/ftp/目录下写入一些内容
[root@localhost ~]# echo CSDN >> /var/ftp/test.txt
在浏览器中输入ftp://192.168.11.38
同时可以下载test.txt 这个文件,查看文件的内容
7.客户机( Linux系统)登录FTP服务
匿名访问模式的FTP根目录为/var/ftp. ftp命令用于使用FTP服务, 格式为:
ftp [参数] [FTP主机]
(1)安装ftp客户端
[root@localhost ~]# yum -y install ftp
(2)访问ftp服务器
[root@localhost ~]# ftp 192.168.11.38
今天的分享就到这里,大家有什么问题可以直接私信或者评论,博主肯定会回复的。希望大家指出我的不足之处,我们一起努力。创作不易,希望大家给个赞。
cs