首先给虚拟机分给IP地址 关闭防火墙等操作使主机和虚拟机之间可以通信
在D盘中输入“ftp://虚拟机IP地址” 找到pub文件夹
下面进行一系列操作使得可以将主机上的文件上传到pub文件夹中1.现复制一份,以防自己更改错误无法找回
cp /etc/vsftpd/vsftpd.conf /test2.进入vsftpd.conf
[root@localhost /]# vi /etc/vsftpd/vsftpd.conf3.输入“:set nu”后进行如下图修改,修改完成按 esc “:wq”保存退出
4.运行vsftpd 不报错证明修改成功
systemctl restart vsftpd5.修改ftp权限
由图可以看到没有写的功能,chmod 777 pub 后,有写的功能
[root@localhost /]# cd /var/ftp [root@localhost ftp]# ls -l 总用量 0 drwxr-xr-x. 2 root root 6 10月 14 2020 pub [root@localhost ftp]# chmod 777 pub [root@localhost ftp]# ls -l 总用量 0 drwxrwxrwx. 2 root root 6 10月 14 2020 pub v6.此时还是不能把文件拖拽到pub文件夹中,执行强命令
# setenforce 07.此时可以把文件成果拖拽到pub文件夹中 ,查看用户登录次数和操作
[root@localhost log]# ls xferlog xferlog [root@localhost log]# vi xferlog [root@localhost log]# vi xferlog [root@localhost log]# vi xferlog [root@localhost log]# cd /var/log/httpd [root@localhost httpd]# pwd /var/log/httpd [root@localhost httpd]# ls access_log access_log-20220425 error_log error_log-20220425 [root@localhost httpd]# more access_log-20220425
二、把ftp服务和网页服务连在一起 1.新建一个word文档,保存为html格式,移入到pub中 2.输入指令,可以看到begin.html在html文件夹下
[root@localhost html]# cp /var/ftp/pub/begin.html /var/www/html [root@localhost html]# ls begin.html hello.html index.html
[root@localhost html]# cp /var/ftp/pub/begin.html /var/www/html [root@localhost html]# ls begin.html hello.html index.html [root@localhost html]# cd /var/www/html [root@localhost html]# chmod 777 begin.html [root@localhost html]# ls begin.html hello.html index.html [root@localhost html]# cd /var/log/ [root@localhost log]# ls anaconda dmesg.old messages speech-dispatcher vmware-network.5.log wpa_supplicant.log audit firewalld messages-20220425 spooler vmware-network.6.log wtmp boot.log gdm pluto spooler-20220425 vmware-network.7.log xferlog boot.log-20220425 glusterfs ppp swtpm vmware-network.8.log Xorg.0.log btmp grubby_prune_debug qemu-ga tallylog vmware-network.9.log Xorg.0.log.old chrony httpd rhsm tuned vmware-network.log Xorg.1.log cron lastlog sa vmware-network.1.log vmware-vgauthsvc.log.0 Xorg.2.log cron-20220425 libvirt samba vmware-network.2.log vmware-vmsvc-root.log Xorg.9.log cups maillog secure vmware-network.3.log vmware-vmtoolsd-root.log yum.log dmesg maillog-20220425 secure-20220425 vmware-network.4.log vmware-vmusr-root.log [root@localhost log]# cd httpd [root@localhost httpd]# ls access_log access_log-20220425 error_log error_log-20220425 [root@localhost httpd]# cd access_log-20220425 bash: cd: access_log-20220425: 不是目录



