ftp服务器安装与配置


1. ftp服务端的安装
  • 1

如果之前配置过ftp服务器的还是之后配置的服务器,无法启动服务,那么基本是配置出现了错误,那么可先完全卸载后再进行安装。如果无法定位多半是镜像源的问题,请更换阿里源。

sudo apt-get update
sudo apt-get install vsftpd
vsftpd --version //检测是否安装
  • 1
  • 2
  • 3
2. ftp服务端的配置
  • 1
 vim /etc/vsftpd.conf    //编辑配置文件
  • 1

修改vsftpd.conf文件如下:

listen=NO                 //是否开启监听ipv4和ipv6数据
listen_ipv6=YES //是否开启监听ipv6数据 # Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO //是否允许匿名登陆,无需密码 # Uncomment this to allow local users to log in.
local_enable=YES //是否允许本地用户登录 # Uncomment this to enable any form of FTP write command.
write_enable=YES //是否允许登陆者上传文件 # Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022 //设置本地用户默认要减免的权限 # Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES //目录消息,能够给远程登陆的用户发送目录
#
# If enabled, vsftpd will display directory listings with the time
# in your local time zone. The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES //服务器所展示的目录将随着本地时间而改变
#
# Activate logging of uploads/downloads.
xferlog_enable=YES //开启上传下载的日志记录
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES //确认连接传输的端口号为20 # You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log //日志文件存放位置
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES //日志文件采用标准格式 # You may fully customise the login banner string:
ftpd_banner=Welcome to FTP service. //在使用shell时登陆那么会发送欢迎语 # You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES //对本地用户是否实施限制
chroot_list_enable=YES //开启限制白名单
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list //白名单路径,若无这个文件需要自己创建 # This option should be the name of a directory which is empty. Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
# pam_service_name=vsftpd
pam_service_name=ftp //此处ubuntu的系统需要改为ftp # This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO #
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
utf8_filesystem=YES //编码统一为utf8编码,可以识别中文,防止乱码
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
 3. vftpd配置完成
  • 1

添加设置ftpuser用户和访问目录


 1. 创建ftp用户组和用户
  • 1
sudo groupadd ftpusers //创建ftpusers用户组
sudo useradd -m ftpuser_lxr//创建一个用户并且自动创建家目录为/home/ftpuser_lxr
(第二种方式:mkdir /home/ftpuser_lxr //先创建家目录sudo userad -d /home/ftpuser_lxr ftpuser_lxr //绑定这个家目录)
usermod -G ftpusers ftpuser_lxr //将这个新用户加入到ftpusers用户组中
sudo passwd ftpuser_lxr //更改密码
mkdir /home/ftpuser_lxr/ftp //为用户添加一个具有一定权限的文件夹
chmod 777 -R /home/ftpuser_lxr/ftp //新建一个pub目录用于存放文件,并且赋予全部权限
usermod -s /sbin/nologin username //限制用户登录方式;限制用户username只能通过ftp登陆,而不能直接登陆服务器
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
2.将该用户加入vsftpd.chroot_list白名单中
  • 1
mkdir /etc/vsftpd.chroot_list
vim vsftpd.chroot_list
  • 1
  • 2

该文件内容如下:

#白名单
ftpuser_lxr
  • 1
  • 2
3.开启并重启vsftpd的服务
  • 1

systemctl start vsftpd或者service vsftpd start 
systemctl restart vsftpd或者service vsftpd restart


测试

方法一:

打开浏览器,在地址栏输入:ftp://ip_addresss
  • 1

方法二:

 在ubuntu中使用shell输入:ftp ip_address
  • 1

方法三:

 在windows中在文件管理器地址栏输入:ftp://ip_addresss,该方式可以上传下载文件
  • 1

方法四:

 在windows中使用cmd输入:ftp://ip_addresss //显示连接成功

ftp服务器安装与配置的更多相关文章

  1. CentOS下FTP服务器安装与配置

    安装vsftpd yum install vsftpd 启动/重启/关闭vsftpd服务器 CentOS7 以下: 启动: service vsftpd start 停止: service vsftp ...

  2. 第十二章 FTP服务器安装与配置

    习题 1.简述FTP的连接模式. FTP的连接模式有PORT和PASV两种,其中PORT模式是主动模式,PASV是被动模式, 这里所说的主动和被动都是相对于服务器而言的.如果是主动模式,数据端口为20 ...

  3. 【Linux】【CentOS】【FTP】FTP服务器安装与配置(vsftpd、lftp)

    [初次学习.配置的笔记,如有不当,欢迎在评论区纠正 -- 萌狼蓝天 @ 2021-12-02] 基本概念 FTP访问方式 实体账号:本地账户 来宾账户:guest 匿名登录:anonymous fp ...

  4. Windows Server 2008 DNS服务器安装与配置

    Windows Server 2008 DNS服务器安装与配置本文关键字:Windows Server 2008 DNS.IIS 服务器安装与配置,DNS服务器本文来源:http://www.ip-t ...

  5. linux下WEB服务器安装、配置VSFTP

    转载  http://www.oicto.com/centos-vsftp/?tdsourcetag=s_pcqq_aiomsg linux下WEB服务器安装.配置VSFTP 由 admin · 发布 ...

  6. ftp 建立、配置、实用软件 fileZilla server

    ftp 建立.配置.实用软件  fileZilla server

  7. 1.关于UltraEdit中的FTP和Tenent配置,UE远程连接Linux进行文件操作

     1  安装UltraEdit 2  配置FTP相关的配置 文件àFTP/Tenet(T)à watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3 ...

  8. ubuntu14.04 server ftp 服务安装配置详解

    ubuntu14.04 server ftp 服务安装配置详解 cheungmine 2016-01-27 http://wiki.ubuntu.com.cn/Vsftpd 0 安装好vsftpd服务 ...

  9. CentOS7 FTP安装与配置

    1.FTP的安装 #安装yum install -y vsftpd #设置开机启动systemctl enable vsftpd.service #启动systemctl start vsftpd.s ...

随机推荐

  1. Java内存模型JMM 高并发原子性可见性有序性简介 多线程中篇(十)

    JVM运行时内存结构回顾 在JVM相关的介绍中,有说到JAVA运行时的内存结构,简单回顾下 整体结构如下图所示,大致分为五大块 而对于方法区中的数据,是属于所有线程共享的数据结构 而对于虚拟机栈中数据 ...

  2. Flutter 即学即用系列博客——03 在旧有项目引入 Flutter

    前言 其实如果打算在实际项目中引入 Flutter,完全将旧有项目改造成纯 Flutter 项目的可能性比较小,更多的是在旧有项目引入 Flutter. 因此本篇我们就说一说如何在旧有项目引入 Flu ...

  3. 【1】Asp.Net Core2.2从环境配置到应用建立

    作者:Eleven 来源:公众号[软谋net] [前言] .Net Core开源&跨平台,已经肉眼可见将成为.Net平台的未来,在企业招聘需求上已经频频见到,接触到很多公司内部都已经开始尝试C ...

  4. js 获取上传视频的时长、大小、后缀名

    参考资料:获取时长 var fileName = $("#sectionfileUpload").val(); //C:\fakepath\3.jpeg var exts = fi ...

  5. win10安装tensorflow-gpu1.13.1+cuda10.0+cudnn7.3.1

    一,本机配置 Win10 64bit NVIDIA GeForce GTX 960M Python3.7(Anaconda) 二,安装CUDA 亲测,TensorFlow-gpu1.13.1支持cud ...

  6. Head First设计模式读书笔记

    阅读指南: 精读一章内容,手工输入一章代码(注1),与书中描述的思想进行印证,实在搞不懂就放过吧.设计模式绝对不会一次就看懂的. 这本书对于理解设计模式很有帮助,就是例子不太符合中国人的思维模式,但是 ...

  7. arcgis api 4.x for js之图层管理篇

    上篇实现了基础地图加载以及二三维模式切换:本篇的内容则是图层管理控制,从两个不同角度来实现,分别是直接绑定arcgis api提供的图层管理widget(LayerList)以及自定义图层管理图标的点 ...

  8. Android 字体适配方案

    开发过程中,按照UI设计尺寸做好UI页面,当用户自定义自己的手机字体大小之后UI完全没法看了,这个时候就在想让app字体大小始终一致就好了 下面看一下,出现的问题和解决方案     做个简单的例子,先 ...

  9. DEDE整站动态/静态转换

    方法一:使用DEDE后台的SQL命令行工具 入口:织梦后台-系统-SQL命令行工具 DEDE整站动态化 将所有栏目设置为“使用动态页”: 将所有文档设置为“仅动态”: DEDE整站静态化 将所有栏目设 ...

  10. javafx:JavaFX Scene Builder 2.0打开含有第三方jar包的fxml文件报错 Caused by: java.lang.ClassNotFoundException

    报错如下: java.io.IOException: javafx.fxml.LoadException: /C:/User.................test.fxml at com.orac ...