CentOS8 服务篇4:FTP文件传输服务搭建与配置

2023-10-26

FTP 文件传输服务三种配置模式: 匿名模式 本地用户模式 虚拟用户模式
 

安装ftp服务
安装完后再根据不同模式进行配置

[root@localhost yum.repos.d]# yum install -y vsftpd ftp
(vsftpd是搭建ftp服务器的,ftp是拿来测试的)
 
一、匿名模式配置
配置文件修改

[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf
只有第一条是必改的,其他的根据要求添加修改即可
 12 anonymous_enable=YES            允许匿名用户访问
 28 anon_upload_enable=YES          允许匿名用户上传文件
 32 anon_mkdir_write_enable=YES     允许匿名用户创建目录

这两个配置文件里没有,在文件最下面手打
127 anon_umask=022                    匿名用户上传文件的umask值
128 anon_other_write_enable=YES     允许匿名用户修改目录名称或删除目录
 

防火墙设置

一般来说,这两条不打也没问题
清空iptables防火墙策略,保存状态
[root@localhost ~]# iptables -F
[root@localhost ~]# iptables-save 
会弹一堆东西,是正常的

将ftp服务放行,保存防火墙配置
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=ftp
success
[root@localhost ~]# firewall-cmd --reload 
success

selinux配置
[root@localhost ~]# getsebool -a | grep ftp
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> off
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
httpd_can_connect_ftp --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_home_dir --> off
[root@localhost ~]# setsebool -P ftpd_full_access=on
                    -P 永久生效,不然重启就没了

重启与开机自启服务
[root@localhost ~]# systemctl restart vsftpd
[root@localhost ~]# systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
 

测试
这里给上其他用户权限才能创建目录     这个目录是匿名模式下访问的默认目录
[root@localhost ~]# chmod o=rwx /var/ftp/pub
[root@localhost ~]# ftp localhost    客户端验证就输服务器的ip
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.3)
Name (localhost:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 Directory successfully changed.
ftp> mkdir sky
257 "/pub/sky" created
创建成功,验证完成

二、本地用户模式
 

配置文件修改
[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 
默认什么都不改就是可以使用的,下面是一下常用的参数解析

 12 anonymous_enable=NO        禁止匿名用户访问
 15 local_enable=YES           允许本地用户登录
 18 write_enable=YES           允许本地用户上传(允许写入
 22 local_umask=022            本地用户创建文件的umask值

用户是否可以切出目录的三个设置,用的时候去掉#号   
100 #chroot_local_user=YES    
是否开启对本地用户chroot的限制,YES为默认所有用户都不能切出家目录,NO代表默认用户都可以切出家目录

101 #chroot_list_enable=YES    开启特例列表


103 #chroot_list_file=/etc/vsftpd/chroot_list
如果chroot_local_user的值是YES则该文件中的用户是可以切出家目录,如果是NO,该文件中的用户则不能切出家目录,一行一个用户。


禁用用户登录名单配置
只有在 userlist_enable 开启的时候 userlist_deny 才起作用,userlist_deny不打的话默认就是yes
126 userlist_enable=YES   开启“禁用用户名单”,分别为/etc/vsftpd下 /user_list和/ftpusers
127 userlist_deny=NO      只有/etc/vsftpd/user_list 中的用户可以登录ftp
                    
                  YES     只有/etc/vsftpd/user_list和/etc/vsftpd/ftpusers 中的用户不能登录ftp
                            两个文件只要有一个里面有用户名就无法登录

防火墙配置
一般来说,这两条不打也没问题
清空iptables防火墙策略,保存状态
[root@localhost ~]# iptables -F
[root@localhost ~]# iptables-save 
会弹一堆东西,是正常的

将ftp服务放行,保存防火墙配置
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=ftp
success
[root@localhost ~]# firewall-cmd --reload 
success

[root@localhost ~]# getsebool -a | grep ftp
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> off
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
httpd_can_connect_ftp --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_home_dir --> off
[root@localhost ~]# setsebool -P ftpd_full_access=on
                      -P 永久生效,不然重启就没了

重启与开机自启服务
[root@localhost ~]# systemctl restart vsftpd
[root@localhost ~]# systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.

 

测试
使用“禁用用户列表”以外的本地用户登录,或配置userlist_deny=NO后用root登录
[root@localhost ~]# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.3)
Name (localhost:root): root
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> mkdir cy
257 "/root/cy" created
创建成功,ok
 

三、虚拟用户模式配置
创建ftp1和fpt2两个虚拟用户,密码都为123

[root@localhost ~]# cd /etc/vsftpd/
创建一个文件并写入,文件名随意
[root@localhost vsftpd]# vim sky.txt

ftp1    奇数行为用户
123
     偶数行为密码
ftp2
123


使用hash算法将明文转换为数据库文件(为了安全
[root@localhost vsftpd]# db_load -T -t hash -f sky.txt sky.db
降低权限,删除原文件,更安全些,这两步不打也不影响效果
[root@localhost vsftpd]# chmod 600 sky.db 
[root@localhost vsftpd]# rm -rf sky.txt 

创建供虚拟用户映射的本地用户  
这个家目录是为了方便管理ftp,也可以换  不让登录是为了安全
[root@localhost ~]# useradd -d /var/ftproot -s /sbin/nologin ftpuser
[root@localhost ~]# chmod -Rf 755 /var/ftproot/

创建PAM文件,直接进入vsftpd更改,或创建vsftpd.vu文件进行编写
[root@localhost ~]# vim /etc/pam.d/vsftpd.vu 
auth required pam_userdb.so db=/etc/vsftpd/sky
account required pam_userdb.so db=/etc/vsftpd/sky


 

配置文件和虚拟用户权限设置
 [root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 
 12 anonymous_enable=NO

 15 local_enable=YES

 18 write_enable=YES

 22 local_umask=022
 
最下面添加      
    
127 guest_enable=YES                    开启虚拟用户模式
128 guest_username=ftpuser              指定虚拟用户账户(映射用户
129 pam_service_name=vsftpd.vu          指定PAM文件        
130 user_config_dir=/etc/vsftpd/user    虚拟用户权限配置文件存放路径
131 allow_writeable_chroot=YES          
允许对囚禁的FTP根目录执行写入操作,而且不拒绝用户登录请求
    (这个不打就登录不了,应该是家目录的原因,改成其他的普通目录应该就不用加这条了)

创建虚拟用户权限配置文件存放路径
[root@localhost ~]# mkdir /etc/vsftpd/user      目录名随意,但要与配置文件中一致

对应虚拟用户名创建权限配置文件(名字一样),权限使用匿名用户权限配置
[root@localhost ~]# vim /etc/vsftpd/user/ftp1    
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
可以上传文件,创建、修改、删除目录

[root@localhost ~]# touch /etc/vsftpd/user/ftp2
创文件不编辑就是什么权限都不给              

防火墙设置
一般来说,这两条不打也没问题
清空iptables防火墙策略,保存状态
[root@localhost ~]# iptables -F
[root@localhost ~]# iptables-save 
会弹一堆东西,是正常的

将ftp服务放行,保存防火墙配置
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=ftp
success
[root@localhost ~]# firewall-cmd --reload 
success

[root@localhost ~]# getsebool -a | grep ftp
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> off
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
httpd_can_connect_ftp --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_home_dir --> off
[root@localhost ~]# setsebool -P ftpd_full_access=on
                      -P 永久生效,不然重启就没了
        

重启与开机自启服务
[root@localhost ~]# systemctl restart vsftpd
[root@localhost ~]# systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
 

测试
[root@localhost ~]# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.3)
Name (localhost:root): ftp1
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> mkdir tt
257 "/tt" created        可以创建文件
ftp> quit
221 Goodbye.

[root@localhost ~]# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.3)
Name (localhost:root): ftp2
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> mkdir cc
550 Permission denied.        无权限创建文件

其余配置文件参数
自带
42 connect_from_port_20=YES            允许服务器主动模式(从20端口建立数据连接)
114 listen=NO                          是否以独立运行方式监听服务
 
  
手打
pasv_enable=YES                          允许服务器被动模式
listen_address=IP地址                    设置要监听的IP地址
listen_port=21                           设置FTP服务的监听端口
download_enable=YES                      是否允许下载文件
max_clients=0                            设置最大连接数,0为不限制
max_per_ip=0                             同一IP的最大连接数,0为不限制
local_root=/home             限制本地用户活动目录
anon_root=/home                     限制匿名用户活动目录
 

ftp连接后的基本命令
get  下载文件
put  上传文件
mget  mput  一次下载  上传 多个文件
dir   查看当前目录下的目录  !dir  查看本地的
pwd  当前目录路径
lcd   更改到本地目录
bye  退出

 

配置文件详解
[root@localhost ~]# vim /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.

匿名用户访问,YES是允许,NO是拒绝
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO

# Uncomment this to allow local users to log in.
# 本地用户登录,YES是允许,NO是拒绝.默认访问的是本地用户家目录,如果你开启了selinux
# 请设置开启布尔值ftp_home_dir为ON
# When SELinux is enforcing check for SE bool ftp_home_dir
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,
# 上传的权限是022,使用的是umask权限。对应的目录是755,文件是644
# if your users expect that (022 is used by most other ftpd's)
local_umask=022

# 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.
# 开启目录欢迎消息,一般对命令行登陆有效
dirmessage_enable=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

# 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
#所有者为whoever
#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.
# 日志文件采用标准格斯
xferlog_std_format=YES

# 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.
# FTP子进程管理用户
#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”请求,该操作是不安全的默认禁止。
#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模式传输数据
#ascii_upload_enable=YES
#该选项用于指定是否允许下载时以ASCII模式传输数据
#ascii_download_enable=YES

# You may fully customise the login banner string:
# FTP文本界面登陆欢迎词
#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.
# 是否开启拒绝的Email功能
#deny_email_enable=YES
# (default follows)
# 指定保存被拒接的Email地址的文件
#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的限制,YES为默认所有用户都不能切出家目录,NO代表默认用户都可以切出家目录
# 设置方法类似于:YES拒绝所有,允许个别    NO  允许所有拒绝个别
#chroot_local_user=YES

#开启特例列表
#chroot_list_enable=YES
# (default follows)
# 如果chroot_local_user的值是YES则该文件中的用户是可以切出家目录,如果是NO,该文件中的用户则不能切出家目录
# 一行一个用户。
#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 递归查询功能 ls -R
#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.
# 是否开启ftp独立模式在IPV4
listen=NO

# 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 !!
# 是否开启ftp独立模式在ipv6
listen_ipv6=YES


#启用pam模块验证
pam_service_name=vsftpd
#是否开启userlist功能.

#是否启用用户列表功能
userlist_enable=YES

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CentOS8 服务篇4:FTP文件传输服务搭建与配置 的相关文章

  • 如何从脚本编辑 /etc/sudoers?

    我需要编辑 etc sudoers从脚本中添加 删除白名单中的内容 假设我有一个可以处理普通文件的命令 我如何将其应用到 etc sudoers 我可以复制并修改它 然后有visudo用修改后的副本替换原始版本 通过提供我自己的脚本 EDI
  • 应用程序中两个不同版本的库

    考虑一个场景 其中有两个不同版本的共享库 考虑 A 1 so 链接到 B so A 2 so 链接到 C so 现在 B so 和 C so 都链接到 d exe 当 B so 想要调用 A 1 so 中的函数时 它最终会调用 A 2 so
  • 对于任何真实数据集,数据压缩比的最小可能值是多少

    我在写信ZLIB类似于嵌入式硬件压缩器的 API 它使用 deflate 算法来压缩给定的输入流 在进一步讨论之前 我想解释一下数据压缩率 数据压缩率定义为未压缩大小与压缩大小之间的比率 压缩比通常大于一 这意味着压缩数据通常比未压缩数据小
  • Vagrant 遇到问题 - “404 - 未找到”

    我正在尝试使用 Vagrant 制作一个 LAMP 盒子 有人告诉我它使用起来非常简单 我对网络和虚拟机完全陌生 对 Linux Ubuntu 的经验也很少 我目前已尝试按照官方文档页面上的教程进行操作 http docs vagrantu
  • 在 scapy 中通过物理环回发送数据包

    我最近发现了 Scapy 它看起来很棒 我正在尝试查看 NIC 上物理环回模块 存根上的简单流量 但是 Scapy sniff 没有给出任何结果 我正在做的发送数据包是 payload data 10 snf sniff filter ic
  • Linux shell 从用户输入中获取设备 ID

    我正在为一个程序编写安装脚本 该程序需要在其配置中使用 lsusb 的设备 ID 因此我正在考虑执行以下操作 usblist lsusb put the list into a array for each line use the arr
  • /sys/device/ 和 dmidecode 报告的不同 CPU 缓存大小

    我正在尝试获取系统中不同缓存级别的大小 我尝试了两种技术 a 使用 sys device 中的信息 这是输出 cat sys devices system cpu cpu0 cache index1 size 32K cat sys dev
  • 正则表达式删除块注释也删除 * 选择器

    我正在尝试使用 bash 从 css 文件中删除所有块注释 我有以下 sed 命令的正则表达式 sed r s w s w d 这可以很好地去除块注释 例如 This is a comment this is another comment
  • 为 Linux 编译 Objective-C 应用程序(API 覆盖范围)

    我可能在这里问一些奇怪的问题 但我不确定从哪里开始 问题是我正在考虑使用 Obj C 和 Foundation 类在 Mac 上编写一个命令行工具 但存在一个非常大的风险 那就是我希望能够为不同的 Linux 发行版编译它 以便将来作为服务
  • Linux无法删除文件

    当我找到文件时 我在删除它们时遇到问题 任务 必须找到带有空格的文件并将其删除 我的尝试 rm find L root grep i 但我有错误 rm cannot remove root test No such file or dire
  • Python 3.4.3 subprocess.Popen 在没有管道的情况下获取命令的输出?

    我试图将命令的输出分配给变量 而不让命令认为它正在通过管道传输 原因是 如果正在通过管道传输 则相关命令会给出未格式化的文本作为输出 但如果从终端运行 则会给出颜色格式化的文本 我需要获取这种颜色格式的文本 到目前为止我已经尝试了一些事情
  • Linux 使用 boost asio 拒绝套接字绑定权限

    我在绑定套接字时遇到问题 并且以用户身份运行程序时权限被拒绝 这行代码会产生错误 acceptor new boost asio ip tcp acceptor io boost asio ip tcp endpoint boost asi
  • 为什么 fork 炸弹没有使 android 崩溃?

    这是最简单的叉子炸弹 我在许多 Linux 发行版上执行了它 但它们都崩溃了 但是当我在 android 终端中执行此操作时 即使授予后也没有效果超级用户权限 有什么解释为什么它没有使 Android 系统崩溃吗 一句话 ulimit Li
  • grep 排除文件的数组参数

    我想从我的文件中排除一些文件grep命令 为此我使用参数 exclude excluded file ext 为了更容易阅读 我想使用包含排除文件的 bash 数组 EXCLUDED FILES excluded file ext 然后将
  • 在 docker 中重定向命令输出

    我想为我的服务器做一些简单的日志记录 它是一个在 Docker 容器中运行的小型 Flask 应用程序 这是 Dockerfile Dockerfile FROM dreen flask MAINTAINER dreen WORKDIR s
  • 批量删除文件名中包含 BASH 中特殊字符的子字符串

    我的目录中有一个文件列表 opencv calib3d so2410 so opencv contrib so2410 so opencv core so2410 so opencv features2d so2410 so opencv
  • 找不到包“gdk-pixbuf-2.0”

    我正在尝试在 Amazon Linux 发行版实例上构建 librsvg 我已经通过 yum 安装了大部分依赖项 其中一些在实例上启用的默认 yum 存储库中不可用 因此必须从头开始构建它们 我已经走了很远 但还停留在最后一点 跑步时sud
  • 仅使用containerd(不使用Docker)修剪容器镜像

    如果我刚刚containerd安装在 Linux 系统上 即 Docker 是not安装 如何删除未使用的容器映像以节省磁盘空间 Docker 就是这么方便docker system prune https docs docker com
  • Linux 中 m 标志和 o 标志将存储在哪里

    我想知道最近收到的路由器通告的 m 标志和 o 标志的值 从内核源代码中我知道存储了 m 标志和 o 标志 Remember the managed otherconf flags from most recently received R
  • SSH,运行进程然后忽略输出

    我有一个命令可以使用 SSH 并在 SSH 后运行脚本 该脚本运行一个二进制文件 脚本完成后 我可以输入任意键 本地终端将恢复到正常状态 但是 由于该进程仍在我通过 SSH 连接的计算机中运行 因此任何时候它都会登录到stdout我在本地终

随机推荐

  • 李宏毅深度学习之集成学习

    1 bagging 没有顺序的 bagging是将单个函数的结果进行average 回归 或voting 分类 当在model很复杂的情况下 担心过拟合问题 可以做bagging 1 1容易过拟合的模型 1 1 1decision tree
  • flutter 页面缓存

    flutter页面缓存方法 混入AutomaticKeepAliveClientMixin部件设置页面缓存 在动态部件内 class Page1 extends StatefulWidget override Page1State crea
  • js逆向 webpack_js逆向之webpack模块

    目标网址 b aHR0cHM6Ly93d3cuZ205OS5jb20v 开始控制台 跟xhr调用栈 打上断点 再次请求 发现加密函数 跟进去 Webpack 这就是webpack的基本模型 两种形态一个参数是list 一个是object 再
  • C#程序删除自己

    private static void DeleteItselfByCMD ProcessStartInfo psi new ProcessStartInfo cmd exe C ping 1 1 1 1 n 1 w 1000 gt Nul
  • Nand Flash,Nor Flash,CFI Flash,SPI Flash 之间的关系

    前言 在嵌入式开发中 如uboot的移植 kernel的移植都需要对Flash 有基本的了解 下面细说一下标题中的中Flash中的关系 一 Flash的内存存储结构 flash按照内部存储结构不同 分为两种 nor flash和nand f
  • SpringBootWeb登录认证

    登录服务端的核心逻辑就是 接收前端请求传递的 用户名 和 密码 然后再根据用户名和密码查询用户信息 如果用户信息存在 则说明用户输入的用户名和密码正确 如果查询到的用户不存在 则说明用户输入的用户名和密码错误 统一拦截 可以使用两种技术实现
  • 2016年10月—信息安全工程师—上午综合知识(26-30)

    信安16年10月 试题26 26 已知DES算法的S盒如下 如果该S盒的输入110011 则其二进制输出为 A 0110 B 1001 C 0100 D 0101 尚大参考答案 C 解析 本题考查考生对DES算法中S 盒的运用 DES算法是
  • 2.COM接口

    2 1 再谈接口与实现 其实从上一章 COM是个更好的C 可以看出 COM最重要的就是将接口与实现分离 上一章中接口定义头文件中采用C 抽象类的形式 如果调用方是C 环境当然不会有问题 但如果调用方不是C 的编译环境呢 为了把 接口定义 与
  • Mean Average Precision(mAP),Precision,Recall,Accuracy,F1_score,PR曲线、ROC曲线,AUC值,决定系数R^2 的含义与计算...

    背景 之前在研究Object Detection的时候 只是知道Precision这个指标 但是mAP mean Average Precision 具体是如何计算的 暂时还不知道 最近做OD的任务迫在眉睫 所以仔细的研究了一下mAP的计算
  • 期货开户供求平衡周而复始

    1 供求关系和价值规律的演变方程式 人们常说 价格围绕价值波动 傅海棠认为更准确的说法应是 价格围绕成本波动 大部分时间 价格在成本之上 小部分时间 价格在成本之下 价格低了 生产积极性受到抑制 供应减少 而低价还刺激需求 一个行业如果商品
  • 如何将你接入微信自动回答别人的问题

    要将我接入微信自动回答别人的问题 您需要使用微信的开放平台 API 使用开放平台 API 您可以创建一个小程序 该小程序可以接收用户发送的消息 并使用我这个语言模型来生成回复消息 具体来说 您需要以下步骤 在微信公众平台上注册一个小程序 并
  • Python每日一记42>>>机器学习中特征重要性feature_importances_

    在进行机器学习算法中 我们常用的算法就像下面的代码形式类型 经历导入数据 预处理 建模 得分 预测 但是总觉得少了点什么 虽然我们建模的目的是进行预测 但是我们想要知道的另一个信息是变量的重要性 在线性模型中 我们有截距和斜率参数 但是其他
  • LDO和DCDC电路的概述和区别

    一 什么是DCDC DCDC的意思是直流变 到 直流 不同直流电源值的转换 只要符合这个定义都可以叫DCDC转换器 常见的DCDC电路有buck boost buck boost分别是降压 升压 降压升压电路 二 什么是LDO LDO 是一
  • Linux驱动——设备树

    在对总线设备驱动进行详细说明时可以看出 虽然总线设备驱动可以实现驱动和设备分离 但是总线设备驱动引发另外的一个问题就是在相同的芯片不同的开发板上 当外设资源不同时需要在不同的设备文件中去定义引脚 这样就导致开发板中保留大量设备文件 为了解决
  • 多元任务,高额奖金!首届“开放原子开源大赛”等你参与!

    人类有各种交流方式 包括语言 文字 音乐 影像等 有的贴近生活 有的充满艺术感 然而 在人工智能时代 代码作为一种特殊的交流形式愈发重要 它使得人与人 人与机器之间能够高效便捷地沟通 从而为科技发展注入活力 开源 则是让这种交流变得更加丰富
  • Android ADB命令大全(通过ADB命令查看wifi密码、MAC地址、设备信息、操作文件、查看文件、日志信息、卸载、启动和安装APK等)

    ADB很强大 记住一些ADB命令有助于提高工作效率 获取序列号 adb get serialno 查看连接计算机的设备 adb devices 重启机器 adb reboot 重启到bootloader 即刷机模式 adb reboot b
  • URL、URI和URN之间的区别

  • 程序员应该掌握的 10 个搜索技巧

    在今天 用户可以通过搜索引擎轻松找出自己想要的信息 但还是难以避免结果不尽如人意的情况 实际上 用户仅需掌握几个常用技巧即可轻松化解这种尴尬 下面介绍 10 个在进行 Google 搜索时可以使用的便捷技巧 其他搜索引擎也支持这 10 种技
  • C++外观模式

    外观模式 1 外观模式简介及应用场景 外观者模式其实就是相当于对一组子系统功能的组合 对外提供统一的简单接口的模式 当我们在实际开发中 一般情况下是一个单独的子系统对应的是一个独立的功能模块 但是随着业务功能的不断增加 对应子系统的迭代必然
  • CentOS8 服务篇4:FTP文件传输服务搭建与配置

    FTP 文件传输服务三种配置模式 匿名模式 本地用户模式 虚拟用户模式 安装ftp服务 安装完后再根据不同模式进行配置 root localhost yum repos d yum install y vsftpd ftp vsftpd是搭