LINUX 66 FTP 2 ;FTP被动模式;FTP客户服务系统

news2025/6/7 10:58:58

19. 在vim中将所有 abc 替换为 def,在底行模式下执行©?D

A、s/abc/def
B、s/abc/def/g
C、%s/abc/def
D、%s/abc/def/g
在这里插入图片描述

FTP连接

在这里插入图片描述
在这里插入图片描述
用户名应该填什么

[root@code ~]# grep -v ^# /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_root=/date/kefu
chroot_local_user=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
[root@code ~]# man 5 /etc/vsftpd/vsftpd.conf

怎么理解匿名访问FTP anonymous_enable=YES在这里插入图片描述

怎么理解匿名访问FTP anonymous_enable=NO

如果不支持匿名访问,用户名和密码是什么
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  chroot_local_user
              If set to YES, local users will be (by default) placed in a chroot() jail in their home directory after login.  Warning:
              This option has security implications, especially if the users have upload permission, or shell access. Only  enable  if
              you  know what you are doing.  Note that these security implications are not vsftpd specific. They apply to all FTP dae‐
              mons which offer to put local users in chroot() jails.

chroot_local_user
若设置为YES,本地用户在登录后将被默认禁锢在其主目录的chroot()环境中。

  connect_from_port_20
              This controls whether PORT style data connections use port 20 (ftp-data) on the server machine.  For  security  reasons,
              some  clients  may  insist  that this is the case. Conversely, disabling this option enables vsftpd to run with slightly
              less privilege.

connect_from_port_20 该选项控制PORT模式数据连接是否使用服务器机器的端口20(ftp-data)。
主动模式

listen If  enabled,  vsftpd  will  run  in  standalone mode. This means that vsftpd must not be run from an inetd of some kind.
              Instead, the vsftpd executable is run once directly. vsftpd itself will then take care of  listening  for  and  handling
              incoming connections.

如果启用,vsftpd将以独立模式运行。这意味着vsftpd不应从任何类型的inetd启动运行。
相反,vsftpd可执行文件将直接运行一次。之后vsftpd会自行负责监听和处理传入的连接。

怎么理解 vsftpd将以独立模式运行。这意味着vsftpd不应从任何类型的inetd启动运行。在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

local_root
              This  option represents a directory which vsftpd will try to change into after a local (i.e. non-anonymous) login. Fail‐
              ure is silently ignored.

              Default: (none)


local_root
该选项表示 vsftpd 在本地(即非匿名)登录后尝试切换进入的目录。若切换失败将静默忽略。
默认值:(无)

userlist_enable
              If  enabled,  vsftpd will load a list of usernames, from the filename given by userlist_file.  If a user tries to log in
              using a name in this file, they will be denied before they are asked for a password. This may be  useful  in  preventing
              cleartext passwords being transmitted. See also userlist_deny.

              Default: NO

如果启用,vsftpd将从userlist_file指定的文件名加载用户名列表。如果用户尝试使用该文件中的用户名登录,系统会在要求输入密码前拒绝其访问。这有助于防止明文密码传输。另请参阅userlist_deny。
黑名单

[root@code vsftpd]# cd /date/kefu
[root@code kefu]# ls
[root@code kefu]# mkdir 1.txt
[root@code kefu]#

在这里插入图片描述

为什么kefu能登录FTP,code不可以

[root@code ~]# grep -v ^# /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_root=/date/kefu
chroot_local_user=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
[root@code ~]# man 5 /etc/vsftpd/vsftpd.conf

推测没有code 用户
使用tom可以登录

使用浏览器为什么无法登录ftp

在这里插入图片描述

ftp被动模式下,客户端比服务器端有利,如何理解

在这里插入图片描述
服务器更好调整
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

FTP任务解决方案:客户服务系统

kefu 123 登录系统
不允许匿名访问
文档保存在/data/kefu
kefu 只能在/data/kefu中活动
在这里插入图片描述
在这里插入图片描述

21. 当需要将很多个文件压缩成一个文件时,可以选择以下哪些压缩工具(ACB)?

A、gzip
B、zip
C、tar
D、unzip
在这里插入图片描述

源码

root@192.168.235.20's password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to root@192.168.235.20                               │
     │   • SSH compression : ✘                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  : ✔  (remote display is forwarded through SSH) │
     │   • DISPLAY         : ✔  (automatically set on remote server)      │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Last login: Thu Jun  5 19:31:29 2025 from 192.168.235.1
[root@code ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.235.20  netmask 255.255.255.0  broadcast 192.168.235.255
        inet6 fe80::20c:29ff:fe97:845e  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:97:84:5e  txqueuelen 1000  (Ethernet)
        RX packets 1100712  bytes 444103092 (423.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 964272  bytes 498686849 (475.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

您在 /var/spool/mail/root 中有新邮件
[root@code ~]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2025-06-04 20:54:02 CST; 1 day 23h ago
  Process: 51486 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 51488 (vsftpd)
    Tasks: 1
   CGroup: /system.slice/vsftpd.service
           └─51488 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

6月 04 20:54:02 code systemd[1]: Stopped Vsftpd ftp daemon.
6月 04 20:54:02 code systemd[1]: Starting Vsftpd ftp daemon...
6月 04 20:54:02 code systemd[1]: Started Vsftpd ftp daemon.
您在 /var/spool/mail/root 中有邮件
[root@code ~]# grep ^# /etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
# Uncomment this to enable any form of FTP write command.
#
# 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)
#
# 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
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
# Activate logging of uploads/downloads.
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
# 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
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/xferlog
#
# 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.
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# 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
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode. The vsftpd.conf(5) man page explains
# the behaviour when these options are disabled.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# 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
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
您在 /var/spool/mail/root 中有邮件
[root@code ~]# grep -v ^# /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_root=/date/kefu
chroot_local_user=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
[root@code ~]# man 5 /etc/vsftpd/vsftpd.conf
您在 /var/spool/mail/root 中有邮件
[root@code ~]# cd /etc/vsftpd
[root@code vsftpd]# man 5 vsftpd.conf
您在 /var/spool/mail/root 中有邮件
[root@code vsftpd]# man 5 /etc/vsftpd/vsftpd.conf
您在 /var/spool/mail/root 中有邮件
[root@code vsftpd]# man 5 vsftpd.conf
您在 /var/spool/mail/root 中有邮件
[root@code vsftpd]# ls /kefu
ls: 无法访问/kefu: 没有那个文件或目录
[root@code vsftpd]# cd /kefu
-bash: cd: /kefu: 没有那个文件或目录
[root@code vsftpd]# cd /date/kefu
[root@code kefu]# ls
[root@code kefu]# mkdir 1.txt
[root@code kefu]# cd -
/etc/vsftpd
您在 /var/spool/mail/root 中有邮件
[root@code vsftpd]# ls
ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
[root@code vsftpd]# cd ~
[root@code ~]# ls
2-1.java  alll1            app       axel-2.4.tar.gz  cc.conf  initial-setup-ks.cfg       ok   readme7
2.java    anaconda-ks.cfg  axel-2.4  bb.conf          code     inotify-tools-3.13.tar.gz  okl  readme.txt
[root@code ~]# tail -5 /etc/passwd
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
您在 /var/spool/mail/root 中有邮件
[root@code ~]# tail -10 /etc/passwd
boss01:x:1013:1004::/home/boss01:/bin/bash
cw02:x:1014:1224::/home/cw02:/bin/bash
sc02:x:1015:1226::/home/sc02:/bin/bash
rs02:x:1016:1225::/home/rs02:/bin/bash
harry:x:1017:1017::/home/mahei/redhat/harry:/bin/bash
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
[root@code ~]# tail -15 /etc/passwd
tom:x:1008:1008::/home/tom:/bin/bash
jack:x:1009:1009::/home/jack:/bin/bash
cw01:x:1010:1224::/home/cw01:/bin/bash
sc01:x:1011:1226::/home/sc01:/bin/bash
rs01:x:1012:1225::/home/rs01:/bin/bash
boss01:x:1013:1004::/home/boss01:/bin/bash
cw02:x:1014:1224::/home/cw02:/bin/bash
sc02:x:1015:1226::/home/sc02:/bin/bash
rs02:x:1016:1225::/home/rs02:/bin/bash
harry:x:1017:1017::/home/mahei/redhat/harry:/bin/bash
netasha:x:1018:1018::/home/netasha:/bin/bash
sarsh:x:1019:1228::/home/sarsh:/bin/bash
OOO:x:1020:1020::/home/OOO:/bin/bash
jerry:x:1021:1229::/home/jerry:/bin/bash
kefu:x:1022:1022::/home/kefu:/bin/bash
[root@code ~]#

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2402809.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

网心云 OEC/OECT 笔记(2) 运行RKNN程序

目录 网心云 OEC/OECT 笔记(1) 拆机刷入Armbian固件网心云 OEC/OECT 笔记(2) 运行RKNN程序 RKNN OEC/OEC-Turbo 使用的芯片是 RK3566/RK3568, 这个系列是内建神经网络处理器 NPU 的, 利用 RKNN 可以部署运行 AI 模型利用 NPU 硬件加速模型推理. 要使用 NPU, 首先需要在电脑使…

灵活控制,modbus tcp转ethernetip的 多功能水处理方案

油田自动化和先进的油气行业软件为油气公司带来了诸多益处。其中包括&#xff1a; 1.自动化可以消除多余的步骤、减少人为错误并降低运行设备所需的能量&#xff0c;从而降低成本。 2.油天然气行业不断追求高水平生产。自动化可以更轻松地减少计划外停机时间&#xff0c;从而…

深入了解linux系统—— 进程池

前言&#xff1a; 本篇博客所涉及到的代码以同步到本人gitee&#xff1a;进程池 迟来的grown/linux - 码云 - 开源中国 一、池化技术 在之前的学习中&#xff0c;多多少少都听说过池&#xff0c;例如内存池&#xff0c;线程池等等。 那这些池到底是干什么的呢&#xff1f;池…

光电耦合器:数字时代的隐形守护者

在数字化、自动化高速发展的今天&#xff0c;光电耦合器正以一种低调却不可或缺的方式&#xff0c;悄然改变着我们的生活。它不仅是电子电路中的“安全卫士”&#xff0c;更是连接信号世界的“桥梁”&#xff0c;凭借出色的电气隔离能力&#xff0c;为各类设备提供稳定可靠的信…

手机如何防止ip关联?3种低成本方案

在当今数字化时代&#xff0c;手机已成为人们日常生活中不可或缺的工具&#xff0c;无论是社交、购物、支付还是工作&#xff0c;都离不开手机。然而&#xff0c;随着网络技术的不断发展&#xff0c;网络安全问题也日益突出&#xff0c;其中IP关联问题尤为常见。那么&#xff0…

Pandas和Django的示例Demo

以下是一个结合Pandas和Django的示例Demo&#xff0c;展示如何在Django项目中读取、处理和展示Pandas数据。 Pandas和Django的示例Demo 前置条件&#xff1a; 安装python 基础设置 确保已安装Django和Pandas&#xff1a; pip install django pandasInstalling collected p…

【p2p、分布式,区块链笔记 MESH】Bluetooth蓝牙通信拓扑与操作 BR/EDR(经典蓝牙)和 BLE

目录 1. BR/EDR&#xff08;经典蓝牙&#xff09;网络结构微微网&#xff08;Piconet&#xff09;散射网&#xff08;Scatternet&#xff09;蓝牙 BR/EDR 拓扑结构示意图 2. BLE&#xff08;低功耗蓝牙&#xff09;网络结构广播器与观察者&#xff08;Broadcaster and Observer…

航道无人机巡检系统

随着长江干线、京杭运河等航道智慧化升级提速&#xff0c;传统人工巡检模式已难以满足高频次、大范围、高精度的航道管理需求。无人机凭借其灵活机动、多源感知、高效覆盖等优势&#xff0c;正成为航道巡检的“空中卫士”。本文将结合多地成功案例&#xff0c;从选型标准、技术…

【JVM】Java虚拟机(一)——内存结构

目录 一、简介 二、程序计数器 三、虚拟机栈 栈帧结构&#xff1a; 特点&#xff1a; 四、本地方法栈 特点&#xff1a; 五、堆 堆结构&#xff1a; 特点&#xff1a; 对象分配过程&#xff1a; 六、方法区 方法区结构&#xff1a; 特点&#xff1a; 运行时常量池…

从微积分到集合论(1630-1910)(历史简介)——第4章——现代积分理论的起源(Thomas Hawkins)

第 4 章 现代积分理论的起源 (The Origins of Modern Theories of Integration) Thomas Hawkins 目录 4.1 引言(Introduction) 4.2 Fourier分析与任意函数(Fourier analysis and arbitrary functions) 4.3 对Fourier问题的回应(Responses to Fourier)(1821-1854)…

《Linux运维总结:宝德服务器RAID开启(方式一)》

总结&#xff1a;整理不易&#xff0c;如果对你有帮助&#xff0c;可否点赞关注一下&#xff1f; 更多详细内容请参考&#xff1a;Linux运维实战总结 一、背景信息 说明&#xff1a;从客户那里退回来的一台宝德服务器&#xff0c;硬盘不见了&#xff0c;现在需要用两个2T的硬盘…

NY118NY120美光固态闪存NY124NY129

NY118NY120美光固态闪存NY124NY129 美光NY系列固态闪存深度解析&#xff1a;技术、性能与行业洞察 技术架构与核心创新 美光NY系列&#xff08;包括NY118、NY120、NY124、NY129等型号&#xff09;作为企业级存储解决方案的代表作&#xff0c;延续了品牌在3D NAND技术上的深厚…

Odoo 19 路线图(新功能)

Odoo 19 路线图(新功能) Odoo 19 路线图是Odoo官方针对下一版本的发布计划&#xff0c;将在自动化、合规性、用户体验、碳排放报告及本地化等领域推出超过16项新功能。本路线图详细阐述了Odoo 19如何在过往版本基础上进一步提升&#xff0c;助力企业优化销售、财务、运营及客户…

基于NXP例程学习CAN UDS刷写流程

文章目录 前言1.概述1.1 诊断报文 2.协议数据单元(N_PDU)2.1 寻址信息&#xff08;N_AI&#xff09;2.1.1 物理寻址2.1.2 功能寻址2.1.3 常规寻址&#xff08;Normal addressing&#xff09;2.1.4 常规固定寻址&#xff08;Normal fixed addressing&#xff09;2.1.5 扩展寻址&…

基于有效集MPC控制算法的直线同步电机simulink建模与仿真,MPC使用S函数实现

目录 1.课题概述 2.系统仿真结果 3.核心程序 4.系统仿真参数 5.系统原理简介 6.参考文献 7.完整工程文件 1.课题概述 有效集算法通过迭代地选择一组 "有效" 约束&#xff0c;将约束优化问题转化为一系列无约束或等式约束优化问题。直线同步电机 (Linear Synch…

让敏感数据在流转与存储中始终守护在安全范围

在企业数字化运营浪潮中&#xff0c;企业内部应用服务器面临着非法访问、数据泄露等风险&#xff0c;如何全面守护应用服务器文件安全&#xff0c;让敏感数据在流转与存储中始终守护在安全范围&#xff1f; 服务器白名单让数据流转安全又高效 天 锐 蓝盾的服务器白名单功能既…

【Linux】find 命令详解及使用示例:递归查找文件和目录

【Linux】find 命令详解及使用示例&#xff1a;递归查找文件和目录 引言 find 是 Linux/Unix 系统中强大的文件搜索工具&#xff0c;用于在目录层次结构中递归查找文件和目录。它提供了丰富的搜索条件和灵活的操作选项&#xff0c;可以满足从简单到复杂的各种文件查找需求。 …

【论文阅读笔记】万花筒:用于异构多智能体强化学习的可学习掩码

摘要 在多智能体强化学习&#xff08;MARL&#xff09;中&#xff0c;通常采用参数共享来提高样本效率。然而&#xff0c;全参数共享的流行方法通常会导致智能体之间的策略同质&#xff0c;这可能会限制从策略多样性中获得的性能优势。为了解决这一关键限制&#xff0c;我们提出…

负载均衡LB》》HAproxy

Ubuntu 22.04 安装HA-proxy 官网 资料 # 更新系统包列表&#xff1a; sudo apt update # 安装 HAproxy sudo apt install haproxy -y # 验证安装 haproxy -v # 如下图配置 Haproxy 在这里插入代码片》》》配置完之后 重启 Haproxy sudo systemctl restart haproxy 补充几…

UE 5 和simulink联合仿真,如果先在UE5这一端结束Play,过一段时间以后**Unreal Engine 5** 中会出现显存不足错误

提问 UE5报错如图。解析原因 回答 你遇到的这个错误提示是&#xff1a; “Out of video memory trying to allocate a rendering resource. Make sure your video card has the minimum required memory, try lowering the resolution and/or closing other applications tha…