Linux-文件服务FTP

学习目录: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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苏木三少

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值