Ubuntu 下安装和配置 FTP

linux系统下FTP服务器配置方法:
https://www.cnblogs.com/hexige/p/7809481.html

vsftpd.conf.5配置文件手册(中文版)
https://blog.csdn.net/m0_37355951/article/details/76974622


vsftpd开机自动运行

1、使用chkconfig

[root@localhost ~]# chkconfig --level 35 vsftpd on
[root@localhost ~]# chkconfig --list | grep vsftpd
vsftpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关闭
这样,vsftpd就在级别3和级别5上面运行啦!

2、修改/etc/rc.local文件,加入/etc/rc.d/init.d/vsftpd start这行。

[root@localhost ~]# vi /etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/etc/rc.d/init.d/vsftpd start

3、修改/etc/rc.local文件,加入/etc/rc.d/init.d/vsftpd start这行。

[root@localhost ~]# cat /etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/etc/rc.d/init.d/vsftpd start

以上三种方法的介绍,修改完成之后,重新启动服务器。

[root@localhost ~]# reboot

重新查看vsftpd的运行状态
[root@localhost ~]# service vsftpd status

4、sysv-rc-conf 工具

按装方法:sudo apt-get install sysv-rc-conf
使用很方便(据说比chkconfig好),直接敲命令:sysv-rc-conf

[root@localhost ~]# sysv-rc-conf

操作方法已经在界面上说了。0-6 分别对应7个启动level。

找到对应的服务和对应的level,打X表示开机启动,不打则表示不启动


常用FTP命令如下表:

命令说明

?查询列出ftp命令

pwd 显示远程主机上的当前工作目录

ls 显示当前远程目录下的内容

cd 切换远程目录

lcd 切换本地工作目录

asc 纯文本方式传输

bin 二进制方式传输

get 从远程服务器上download一个文件

put 上传一个文件到远程服务器上

mget 下载多个文件

mput 上传多个文件

bye 断开与服务器的连接

quit 退出服务器


service vsftpd start:启动vsftpd服务器

service vsftpd restart:重启vsftpd服务器

service vsftpd stop:停止vsftpd服务器

service vsftpd status:查询vsftpd服务器


1.删除指定的文件:DELETE 文件名;

2.删除整个文件夹内的文件

(1).cd 到当前文件夹目录

(2). 删除一个文件夹下所有的文件:MDELETE *;

3.删除指定的多个文件,可以通配符匹配 (例如删除 test1.txt test2.txt test3.txt)

(1).cd 到当前文件夹目录

(2). 删除一个文件夹下所有的满足匹配条件的文件:MDELETE test*.txt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值