Linux611 libvirtb ;FTP vsftpd.conf部分配置文件

MX连不上虚拟机192.168.235.100

ftp

bash 复制代码
[caozx26420@code ~]$ ftp 192.168.235.20
ftp:connect:网络不可达
ftp> bye
[caozx26420@code ~]$ route-nKernel Ip routing tableDestinationGateway
[caozx26420@code ~]$ ip a:
1:lo:<LOOPBACK,UP, LOWER UP> mtu 65536 qdisc noqueue state UNkNowN group default glen 1000
link/loopback 00:00:00:00:00:00 brd00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred lft forever
inet6 ::1/128 scope host
valid lft forever preferred lft forever 
2:ens33:<BROADCAST,MULTICAST> mtu 1500 gdisc pfifo fast state DowN group default qlen 1000
link/ether 00:0c:29:e9: ad:ge brd ff: ff: ff: ff: ff: ff
3:virbrO: <BROADCAST,MULTICAST> mtu 1500 gdisc noqueue state DowN group default glen 1000
link/ether 52:54:00:f5:ea:28 brd ff: ff: ff: ff: ff: ff
4: virbr0-nic: <BROADCAST, MULTICAST> mtu 1500 gdisc pfifo fast master virbr0 state DowN group default qlen 1000
link/ether 52:54:00:f5:ea:28 brd ff: ff: ff: ff: ff: ff
[caozx26420@code]# ifup ens33用户不能控制这一设备,
[caozx26420@code]# sudo susudocaozx26420的密码:
23
对不起,请重试。
[sudo] caozx26420的密码:
[root@code caozx26420]#ifup ens33
精误: 连接微活失败 : No suitable device found for this comection (device virbr0 not available because profile is not compatible with device (mismatchininterface name)).
[root@code caozx26420]#or su ifup ens33bash:or:未找到命令[root@code ca0zx28420|#错误:连接激活失败 :No suitable device found for this connection (device virbr0 not available because profile is not compatiblewith device(mismatching interface name)).bash:未预期的符号'!附近有语法错误

192.168.235.20


好像之前没遇见过 libvirtd服务



systemctl disable



成功

FTP

配置/etc/vsftpd/vsftpd.conf的是?

服务器还是

服务器

因为设置了一系列允许操作

考虑被动模式 连接比较方便

192.168.235.20

bash 复制代码
[root@code ~]# ftp 192.168.235.100
ftp: connect: 没有到主机的路由
ftp> bye
您在 /var/spool/mail/root 中有新邮件
[root@code ~]# ftp 192.168.235.100
Connected to 192.168.235.100 (192.168.235.100).
220 (vsFTPd 3.0.2)
Name (192.168.235.100:root): kefu
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,235,100,142,110).
150 Here comes the directory listing.
226 Directory send OK.
ftp>

OK

/etc/vsftpd/vsftpd.conf配置

bash 复制代码
 grep -v ^# /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_root=/data/kefu
chroot_local_user=YES
allow_writeable_chroot=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
bash 复制代码
 anonymous_enable
              Controls whether anonymous logins are permitted or not. If enabled, both the usernames ftp and anonymous are  recognised
              as anonymous logins.

              Default: YES

anonymous_enable

控制是否允许匿名登录。如果启用,用户名ftp和anonymous都将被识别为匿名登录。

bash 复制代码
  local_enable
              Controls  whether  local  logins are permitted or not. If enabled, normal user accounts in /etc/passwd (or wherever your
              PAM config references) may be used to log in. This must be enable for any non-anonymous login to work, including virtual
              users.

              Default: NO

local_enable

控制是否允许本地登录。如果启用,则可以使用/etc/passwd(或PAM配置指向的位置)中的普通用户帐户进行登录。任何非匿名登录(包括虚拟用户)都必须启用该选项才能正常工作。

bash 复制代码
 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 在本地(即非匿名)登录后尝试切换进入的目录。

失败时会被静默忽略。

bash 复制代码
       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.

              Default: NO

chroot_local_user

如果设置为YES,本地用户登录后默认会被置于其家目录的chroot()监牢中。警告:

此选项具有安全风险,特别是当用户拥有上传权限或shell访问权限时。仅在你清楚自己在做什么的情况下启用。

需注意这些安全风险并非vsftpd特有,它们适用于所有为本地用户提供chroot()监牢功能的FTP守护进程。

默认值: NO

禁锢用户

bash 复制代码
 allow_writeable_chroot
              Allow chroot()'ing a user to a directory writable by that user. Note that setting this to YES is potentially  dangerous.
              For  example,  if  the  user  creates  an  'etc' directory in the new root directory, they could potentially trick the C
              library into loading a user-created configuration file from the /etc/ directory.

              Default: NO

allow_writeable_chroot

允许将用户 chroot() 到该用户可写的目录。注意将此设置为 YES 存在潜在危险。

例如,如果用户在新的根目录中创建了 'etc' 目录,他们可能会欺骗 C 库从 /etc/ 目录加载用户创建的配置文件。

默认值:NO

解决500ops报错

=yes解决

bash 复制代码
  write_enable
              This controls whether any FTP commands which change the filesystem are allowed or not. These commands are:  STOR,  DELE,
              RNFR, RNTO, MKD, RMD, APPE and SITE.

              Default: NO

write_enable

此选项控制是否允许任何会改变文件系统的FTP命令。这些命令包括:STOR(存储)、DELE(删除)、

RNFR(重命名来源)、RNTO(重命名目标)、MKD(创建目录)、RMD(移除目录)、APPE(追加)和SITE(站点参数)。

默认值:NO(禁止)

写总开关

bash 复制代码
 chroot_list_enable
              If activated, you may provide a list of local users who are placed in a chroot()  jail  in  their  home  directory  upon
              login.  The  meaning  is slightly different if chroot_local_user is set to YES. In this case, the list becomes a list of
              users  which  are  NOT  to  be  placed  in  a  chroot()  jail.   By  default,  the  file   containing   this   list   is
              /etc/vsftpd/chroot_list, but you may override this with the chroot_list_file setting.

              Default: NO

chroot_list_enable

如果启用该选项,您可以为本地用户提供一个列表,这些用户登录时将被置于其主目录的 chroot() 监牢中。若 chroot_local_user 设置为 YES,则其含义略有不同------此时该列表变为不会被置于 chroot() 监牢的用户名单。默认情况下,包含此列表的文件是 /etc/vsftpd/chroot_list,但您可以通过 chroot_list_file 设置来更改此路径。

默认值:NO

禁锢目录补充,给部分用户开启

代码

bash 复制代码
[email protected]'s password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to [email protected]                               │
     │   • 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: Mon Jun  9 21:28:56 2025 from 192.168.235.1
[root@code ~]# ftp 192.168.235.100
ftp: connect: 没有到主机的路由
ftp> bye
您在 /var/spool/mail/root 中有新邮件
[root@code ~]# ftp 192.168.235.100
Connected to 192.168.235.100 (192.168.235.100).
220 (vsFTPd 3.0.2)
Name (192.168.235.100:root): kefu
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,235,100,142,110).
150 Here comes the directory listing.
226 Directory send OK.
ftp> ftp -help
?Invalid command
ftp> help
Commands may be abbreviated.  Commands are:

!               debug           mdir            sendport        site
$               dir             mget            put             size
account         disconnect      mkdir           pwd             status
append          exit            mls             quit            struct
ascii           form            mode            quote           system
bell            get             modtime         recv            sunique
binary          glob            mput            reget           tenex
bye             hash            newer           rstatus         tick
case            help            nmap            rhelp           trace
cd              idle            nlist           rename          type
cdup            image           ntrans          reset           user
chmod           lcd             open            restart         umask
close           ls              prompt          rmdir           verbose
cr              macdef          passive         runique         ?
delete          mdelete         proxy           send
ftp> ftp help
?Invalid command
ftp> ?
Commands may be abbreviated.  Commands are:

!               debug           mdir            sendport        site
$               dir             mget            put             size
account         disconnect      mkdir           pwd             status
append          exit            mls             quit            struct
ascii           form            mode            quote           system
bell            get             modtime         recv            sunique
binary          glob            mput            reget           tenex
bye             hash            newer           rstatus         tick
case            help            nmap            rhelp           trace
cd              idle            nlist           rename          type
cdup            image           ntrans          reset           user
chmod           lcd             open            restart         umask
close           ls              prompt          rmdir           verbose
cr              macdef          passive         runique         ?
delete          mdelete         proxy           send
ftp> cd
(remote-directory)
usage: cd remote-directory
ftp> cd /
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (192,168,235,100,135,18).
150 Here comes the directory listing.
226 Directory send OK.
ftp> ls
227 Entering Passive Mode (192,168,235,100,128,103).
150 Here comes the directory listing.
226 Directory send OK.
ftp> cd /root
550 Failed to change directory.
ftp>
bash 复制代码
Network error: Connection timed out

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Session stopped
    - Press <return> to exit tab
    - Press R to restart session
    - Press S to save terminal output to file
[email protected]'s password:
▒▒▒ʱ▒▒ܾ▒
[email protected]'s password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to [email protected]                              │
     │   • 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 failed login: Wed Jun 11 22:26:02 CST 2025 from 192.168.235.1 on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Mon Jun  9 21:28:00 2025 from 192.168.235.1
[code@code ~]$ grep -v ^# /etc/vsftpd/vsftpd.conf
grep: /etc/vsftpd/vsftpd.conf: 权限不够
[code@code ~]$ su - caozx26
su: user caozx26 does not exist
[code@code ~]$ su - caozx26420
密码:
上一次登录:一 6月  9 21:31:44 CST 2025pts/3 上
[caozx26420@code ~]$ sudo su
[sudo] caozx26420 的密码:
[root@code caozx26420]# grep -v ^# /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_root=/data/kefu
chroot_local_user=YES
allow_writeable_chroot=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 caozx26420]# cd /etc/vsftpd
[root@code vsftpd]# man 5 vsftpd.conf
[root@code vsftpd]# man 5 vsftpd.conf
[root@code vsftpd]# vim /etc/vsftpd/vsftpd.conf

192.168.235.100


相关推荐
漫步企鹅9 天前
【FTP】ftp文件传输会丢包吗?批量几百个文件传输,有一些文件没有传输完整,如何解决?
ftp·校验·传输协议·断点续传·重传·丢包
czhc114007566311 天前
LINUX67 FTP 3客户服务系统;FTP 上传、下载测试调试
ftp
tiandyoin17 天前
Chrome 通过FTP,HTTP 调用 Everything 浏览和搜索本地文件系统
前端·chrome·http·ftp·everything
五月高高23 天前
频繁报FTPResponse 421 received.Server closed connection
ftp
bcbobo21cn24 天前
了解FTP搜索引擎
搜索引擎·ftp·ftp搜索
前进的程序员1 个月前
FTP 协议介绍与 C 语言开发案例
网络协议·ftp
习惯就好zz2 个月前
ubuntu1804服务器开启ftp,局域网共享特定文件给匿名用户
ubuntu·ftp·anonymous
virelin_Y.lin2 个月前
系统与网络安全------网络通信原理(6)
安全·web安全·应用层·ftp·dns·telnet
virelin_Y.lin3 个月前
系统与网络安全------Windows系统安全(7)
windows·web安全·系统安全·ftp