栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

学习笔记Linux (二) —— ftp服务

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

学习笔记Linux (二) —— ftp服务

首先给虚拟机分给IP地址 关闭防火墙等操作使主机和虚拟机之间可以通信

在D盘中输入“ftp://虚拟机IP地址” 找到pub文件夹

下面进行一系列操作使得可以将主机上的文件上传到pub文件夹中 

 

1.现复制一份,以防自己更改错误无法找回
 cp /etc/vsftpd/vsftpd.conf /test
2.进入vsftpd.conf
[root@localhost /]# vi /etc/vsftpd/vsftpd.conf
3.输入“:set nu”后进行如下图修改,修改完成按 esc “:wq”保存退出

 

4.运行vsftpd 不报错证明修改成功
 systemctl restart vsftpd
5.修改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
v
6.此时还是不能把文件拖拽到pub文件夹中,执行强命令
# setenforce 0
7.此时可以把文件成果拖拽到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: 不是目录

 

 

 

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/837077.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号