余晖落尽暮晚霞,黄昏迟暮远山寻
本站
当前位置:网站首页 > 编程知识 > 正文

vsftpd相关内容

xiyangw 2023-05-14 11:16 18 浏览 0 评论

安装

yum -y install vsftpd

安装联网过程下载速度慢,请移步更换华为云YUM源,速度快的飞起!(●'?'●)

  • 查看描述及版本信息
rpm -qi vsftpd
[root@bdslave02 ~]# rpm -qi vsftpd
Name        : vsftpd
Version     : 3.0.2
Release     : 29.el7_9
... ... ... ... ... ...(省略部分)
  • 查看安装文件列表
rpm -ql vsftpd | grep -v "share/doc"    ## grep -v 过滤帮助文件
[root@bdslave02 ~]# rpm -ql vsftpd | grep -v "share/doc"
/etc/logrotate.d/vsftpd
/etc/pam.d/vsftpd
/etc/vsftpd
... ... ... ... ... ...(省略部分)
  • 查看配置文件列表
rpm -qc vsftpd
[root@bdslave02 ~]# rpm -qc vsftpd
/etc/logrotate.d/vsftpd
/etc/pam.d/vsftpd
/etc/vsftpd/ftpusers
/etc/vsftpd/user_list
/etc/vsftpd/vsftpd.conf

主配置文件

vi /etc/vsftpd/vsftpd.conf
vim /etc/vsftpd/vsftpd.conf
more  /etc/vsftpd/vsftpd.conf
cat /etc/vsftpd/vsftpd.conf | grep -v "^#"

默认禁止root用户登录

[root@bdslave02 vsftpd]# cat /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

/etc/vsftpd/user_list文件默认是配置黑名单,名单中的用户是不允许登录的。

vsftpd相关内容

参数userlist_deny默认是YES,如果配置成NO,那么名单里的用户是白名单。

[root@bdslave02 vsftpd]#  cat /etc/vsftpd/ftpusers 
# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

/etc/vsftpd/ftpusers 文件中的账户名单是黑名单,是不允许登录的。


开放ftp防火墙

SELinux对ftp会有限制作用,对于学习和测试环境可以关闭。参考:如何关闭SELinux?

firewall-cmd --zone=public --add-service=ftp
firewall-cmd --zone=public --add-service=ftp --permanent

anonymous_enable 是否开启匿名账户

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES

是否开启匿名账户?YES:开启。NO:关闭。

注意:如果不注释“anonymous_enable=YES”,那么默认是允许匿名账户的。

local_enable 是否开启本地账户登录

本地账户就是指Linux系统账户。

# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES

YES:开启。NO:关闭。

write_enable 是否允许写入(上传文件)

# Uncomment this to enable any form of FTP write command.
write_enable=YES

YES:开启。NO:关闭。

local_umask 创建新的文件时权限指定

# 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

local_umask=022时,本地用户创建目录权限是755(777-022),文件权限是644。

anon_upload_enable 是否允许匿名用户上传文件

# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
#anon_upload_enable=YES

YES:开启。NO:关闭。

不推荐开启匿名用户上传文件!

SELinux开启时需要设置参数匿名用户才能上传文件,干脆关了,当然有风险!

匿名用户上传的目录必须有权限,干脆设置755,当然有风险!

参数anon_upload_enable设置成YES,当然有风险!总之,不推荐。

anon_mkdir_write_enable 是否允许匿名用户创建新的目录

# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES

xferlog_enable 是否启用上传和下载的日志文件

# Activate logging of uploads/downloads.
xferlog_enable=YES

connect_from_port_20 指定ftp-data传输数据时用的端口默认是20

# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES

chown_uploads和chown_username指定是否更改上传文件的所有者

# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever

xferlog_file 指定日志文件的位置

# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/xferlog

xferlog_std_format 日志文件是否采用标准格式

# 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

idle_session_timeout 指定用户连接上服务器的超时时间(单位:秒)

# You may change the default value for timing out an idle session.
#idle_session_timeout=600

data_connection_timeout 指定数据传输结束超时时间断开(单位:秒)

# You may change the default value for timing out a data connection.
#data_connection_timeout=120

nopriv_user 指定非特权的ftp用户

# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure

ftpd_banner 当用户登录时显示的欢迎信息字符串

# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.

chroot_local_user和chroot_list_enable等参数 更改用户登录后进入的目录

# 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

相关推荐

辞旧迎新,新手使用Containerd时的几点须知

相信大家在2020年岁末都被Kubernetes即将抛弃Docker的消息刷屏了。事实上作为接替Docker运行时的Containerd在早在Kubernetes1.7时就能直接与Kubelet集成使...

分布式日志系统ELK+skywalking分布式链路完整搭建流程

开头在分布式系统中,日志跟踪是一件很令程序员头疼的问题,在遇到生产问题时,如果是多节点需要打开多节点服务器去跟踪问题,如果下游也是多节点且调用多个服务,那就更麻烦,再者,如果没有分布式链路,在生产日志...

Linux用户和用户组管理

1、用户账户概述-AAA介绍AAA指的是Authentication、Authorization、Accounting,即认证、授权和审计。?认证:验证用户是否可以获得权限,是3A的第一步,即验证身份...

linux查看最后N条日志

其实很简单,只需要用到tail这个命令tail-100catalina.out输入以上命令,就能列出catalina.out的最后100行。...

解决linux系统日志时间错误的问题

今天发现一台虚拟机下的系统日志:/var/log/messages,文件时间戳不对,跟正常时间差了12个小时。按网上说的执行了servicersyslogrestart重启syslog服务,还是不...

全程软件测试(六十二):软件测试工作如何运用Linux—读书笔记

从事过软件测试的小伙们就会明白会使用Linux是多么重要的一件事,工作时需要用到,面试时会被问到,简历中需要写到。对于软件测试人员来说,不需要你多么熟练使用Linux所有命令,也不需要你对Linux...

Linux运维之为Nginx添加错误日志(error_log)配置

Nginx错误日志信息介绍配置记录Nginx的错误信息是调试Nginx服务的重要手段,属于核心功能模块(nginx_core_module)的参数,该参数名字为error_log,可以放在不同的虚机主...

Linux使用swatchdog实时监控日志文件的变化

1.前言本教程主要讲解在Linux系统中如何使用swatchdog实时监控日志文件的变化。swatchdog(SimpleWATCHDOG)是一个简单的Perl脚本,用于监视类Unix系统(比如...

syslog服务详解

背景:需求来自于一个客户想将服务器的日志转发到自己的日志服务器上,所以希望我们能提供这个转发的功能,同时还要满足syslog协议。1什么是syslog服务1.1syslog标准协议如下图这里的fa...

linux日志文件的管理、备份及日志服务器的搭建

日志文件存放目录:/var/log[root@xinglog]#cd/var/log[root@xinglog]#lsmessages:系统日志secure:登录日志———————————...

运维之日志管理简介

日志简介在运维过程中,日志是必不可少的东西,通过日志可以快速发现问题所在。日志分类日志分类,对不同的日志进行不同维度的分析。操作系统日志操作系统是基础,应用都是在其之上;操作系统日志的分析,可以反馈出...

Apache Log4j 爆核弹级漏洞,Spring Boot 默认日志框架就能完美躲过

这两天沸沸扬扬的Log4j2漏洞门事件炒得热火朝天:突发!ApacheLog4j2报核弹级漏洞。。赶紧修复!!|Java技术栈|Java|SpringBoot|Spring...

Linux服务器存在大量log日志,如何快速定位错误?

来源:blog.csdn.net/nan1996jiang/articlep/details/109550303针对大量log日志快速定位错误地方tail/head简单命令使用:附加针对大量log日志...

Linux中查看日志文件的正确姿势,求你别tail走天下了!

作为一个后端开发工程师,在Linux中查看查看文件内容是基本操作了。尤其是通常要分析日志文件排查问题,那么我们应该如何正确打开日志文件呢?对于我这种小菜鸡来说,第一反应就是cat,tail,vi(或...

分享几款常用的付费日志系统,献给迷茫的你!

概述在前一篇文章中,我们分享了几款免费的日志服务器。他们各有各的特点,但是大家有不同的需求,有时免费的服务器不能满足大家的需要,下面推荐几款付费的日志服务器。1.Nagios日志服务器Nagio...

取消回复欢迎 发表评论: