FTP文件传输协议

FTP

文章目录

  • FTP
    • 1. ftp简介
    • 2. ftp架构
    • 3. ftp数据连接模式
    • 4. 用户认证
    • 5. vsftpd
      • 5.1 vsftpd安装
      • 5.2 配置匿名用户ftp
        • 5.2.1上传(下面使用的是FileZilla软件)
        • 5.2.2下载
        • 5.2.3创建
        • 5.2.4删除
      • 5.3配置本地(系统)用户ftp
        • 5.3.1上传
        • 5.3.2下载
        • 5.3.3创建
        • 5.3.4删除
      • 5.4配置虚拟用户ftp
      • 5.5FTP应用工具
      • 5.6LFTP应用工具
      • 5.7wget应用工具

1. ftp简介

网络文件共享服务主流的主要有三种,分别是ftp、nfs、samba。

FTP是File Transfer Protocol(文件传输协议)的简称,用于internet上的控制文件的双向传输。

FTP也是一个应用程序,基于不同的操作系统有不同的FTP应用程序,而所有这些应用程序都遵守同一种协议以传输文件。

在FTP的使用当中,用户经常遇到两种概念:下载和上传

下载(Download)上传(Upload)
从远程主机拷贝文件至自己的计算机上将文件从自己的计算机上拷贝至远程主机上

2. ftp架构

FTP工作于应用层,监听于tcp的21号端口,是一种C/S架构的应用程序。其有多种客户端和服务端的应用程序,下面来简单介绍一下

客户端工具服务端软件
ftp lftp,lftpget wget,curl filezilla gftp(Linux GUI) 商业软件(flashfxp,cuteftp)wu-ftpd proftpd(提供web接口的一种ftp服务端程序) pureftp vsftpd(Very Secure) ServU(windows平台的一种强大ftp服务端程序)

3. ftp数据连接模式

ftp有2种数据连接模式:命令连接和数据连接

  • 命令连接:是指文件管理类命令,始终在线的持久性连接,直到用户退出登录为止
  • 数据连接:是指数据传输,按需创建及关闭的连接

其中数据连接需要关注的有2点,一是数据传输格式,二是数据传输模式

数据传输格式有以下两种:

  • 文件传输
  • 二进制传输

数据传输模式也有2种:

  • 主动模式:由服务器端创建数据连接
  • 被动模式:由客户端创建数据连接

两种数据传输模式的建立过程:

传输模式建立过程
主动模式命令连接: Client(1025)–> Server(21) 客户端以一个随机端口(大于1023)来连服务器端的21号端口 数据连接: Server(20/tcp) --> Client(1025+1) 服务器端以自己的20号端口去连客户端创建命令连接时使用的随机端口+1的端口号
被动模式命令连接: Client(1110) --> Server(21) 客户端以一个随机端口来连成服务器端的21号端口 数据连接: Client(1110+1) --> Server(随机端口) 客户端以创建命令连接的端口+1的端口号去连服务器端通过命令连接告知自己的一个随机端口号来创建数据连接

主动模式有个弊端,因为客户端的端口是随机的,客户端如果开了防火墙,
则服务器端去连客户端创建数据连接时可能会被拒绝

4. 用户认证

ftp的用户主要有三种:

  • 虚拟用户:仅用于访问某特定服务中的资源
  • 系统用户:可以登录系统的真实用户
  • 匿名用户

5. vsftpd

此处我们要说的ftp应用程序是vsftpd,这也是在公司中用得最多的一款ftp软件。

5.1 vsftpd安装

//安装
[root@localhost ~]# yum -y install vsftpd
Complete!

//启动服务
[root@localhost ~]# systemctl enable --now vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
[root@localhost ~]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemon
     Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; preset: disabled)
     Active: active (running) since Wed 2023-12-13 14:25:09 CST; 29s ago
   Main PID: 51417 (vsftpd)
      Tasks: 1 (limit: 10820)
     Memory: 708.0K
        CPU: 3ms

//关闭防火墙
[root@localhost ~]# systemctl disable --now firewalld
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# setenforce 0

5.2 配置匿名用户ftp

//编辑配置文件
[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
[root@localhost ~]# systemctl restart vsftpd

//修改所有者为ftp
[root@localhost ~]# cd /var/ftp
[root@localhost ftp]# ls
pub
[root@localhost ftp]# chown -R ftp pub
[root@localhost ftp]# ll -d pub
drwxr-xr-x. 2 ftp root 6 Oct 30 14:29 pub

5.2.1上传(下面使用的是FileZilla软件)

在这里插入图片描述

[root@localhost ftp]# cd pub
[root@localhost pub]# ls
abc.txt
5.2.2下载
[root@localhost pub]# pwd
/var/ftp/pub
[root@localhost pub]# touch file
[root@localhost pub]# ls
abc.txt  file

在这里插入图片描述
在这里插入图片描述

5.2.3创建

在这里插入图片描述

[root@localhost pub]# pwd
/var/ftp/pub
[root@localhost pub]# ls
123  abc.txt  dir  file
5.2.4删除

在这里插入图片描述

在这里插入图片描述

[root@localhost pub]# pwd
/var/ftp/pub
[root@localhost pub]# ls
abc.txt  file

5.3配置本地(系统)用户ftp

//创建用户
[root@localhost ~]# useradd tom
[root@localhost ~]# echo '123456' | passwd --stdin tom
Changing password for user tom.
passwd: all authentication tokens updated successfully.
[root@localhost ~]# id tom
uid=1001(tom) gid=1001(tom) groups=1001(tom)

//编辑配置文件
[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 
local_enable=YES
write_enable=YES
//这两行是禁锢所有的ftp本地用户查看其家目录,只可以看到ftp文件存放目录
chroot_local_user=YES
allow_writeable_chroot=YES   //这一行配置文件没有,要添加
[root@localhost ~]# systemctl restart vsftpd
5.3.1上传

在这里插入图片描述

[root@localhost ~]# su - tom
[tom@localhost ~]$ pwd
/home/tom
[tom@localhost ~]$ ls
笔记.txt
5.3.2下载
[tom@localhost ~]$ pwd
/home/tom
[tom@localhost ~]$ touch test
[tom@localhost ~]$ ls
test  笔记.txt

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

5.3.3创建

在这里插入图片描述

在这里插入图片描述

[tom@localhost ~]$ pwd
/home/tom
[tom@localhost ~]$ ls
test  xx  zz  笔记.txt
5.3.4删除

在这里插入图片描述

在这里插入图片描述

[tom@localhost ~]$ pwd
/home/tom
[tom@localhost ~]$ ls
test  笔记.txt

5.4配置虚拟用户ftp

//
[root@localhost ~]# cd /etc/vsftpd/
[root@localhost vsftpd]# pwd
/etc/vsftpd
[root@localhost vsftpd]# vim vu.list
[root@localhost vsftpd]# cat vu.list
jerry
123456
harry
654321

//安装db_load软件包
[root@localhost ~]# yum provides *bin/db_load
Last metadata expiration check: 1:19:40 ago on Wed 13 Dec 2023 02:40:13 PM CST.
libdb-utils-5.3.28-53.el9.x86_64 : Command line tools for managing Berkeley DB databases
Repo        : appstream
Matched from:
Other       : *bin/db_load

[root@localhost ~]# yum -y install libdb-utils
Complete!

//使用db_load将刚创建的文本格式转换为数据库文件
[root@localhost ~]# db_load -T -t hash -f /etc/vsftpd/vu.list /etc/vsftpd/vu.db
[root@localhost ~]# ls /etc/vsftpd/
ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh  vu.db  vu.list
[root@localhost ~]# cat /etc/vsftpd/vu.db
��MGfEotэh^[root@localhost ~]# 
[root@localhost ~]# mv /etc/vsftpd/vu.list /opt
[root@localhost ~]# chmod 600 /etc/vsftpd/vu.db 
[root@localhost ~]# ll /etc/vsftpd/vu.db 
-rw-------. 1 root root 12288 Dec 13 16:04 /etc/vsftpd/vu.db

//添加虚拟用户,指定虚拟用户家目录,并修改家目录权限
[root@localhost ~]# useradd -d /data -s /sbin/nologin vftp
[root@localhost ~]# id vftp
uid=1002(vftp) gid=1002(vftp) groups=1002(vftp)
[root@localhost ~]# chmod 755 /data
[root@localhost ~]# ll -d /data
drwxr-xr-x. 2 vftp vftp 62 Dec 13 16:12 /data

//为虚拟用户建立PAM认证
[root@localhost ~]# cd /etc/pam.d/
[root@localhost pam.d]# ls
config-util  fingerprint-auth  other   password-auth  remote   runuser-l       sshd              su    sudo-i  system-auth   vlock     vsftpd
crond        login             passwd  postlogin      runuser  smartcard-auth  sssd-shadowutils  sudo  su-l    systemd-user  vmtoolsd
[root@localhost pam.d]# cp vsftpd vsftpd.bak
[root@localhost pam.d]# ls
config-util  fingerprint-auth  other   password-auth  remote   runuser-l       sshd              su    sudo-i  system-auth   vlock     vsftpd
crond        login             passwd  postlogin      runuser  smartcard-auth  sssd-shadowutils  sudo  su-l    systemd-user  vmtoolsd  vsftpd.bak
[root@localhost pam.d]# vim vsftpd
[root@localhost pam.d]# cat vsftpd
#%PAM-1.0
auth required pam_userdb.so db=/etc/vsftpd/vu
account required pam_userdb.so db=/etc/vsftpd/vu

//上面修改了/etc/pam.d/vsftpd里面的内容,为了更好的测试注释配置文件里面的一下内容
[root@localhost pam.d]# vim /etc/vsftpd/vsftpd.conf  
#local_enable=YES
#write_enable=YES
#chroot_local_user=YES
#allow_writeable_chroot=YES
#anon_upload_enable=YES
#anon_mkdir_write_enable=YES
#anon_other_write_enable=YES

//修改vsftpd配置文件,添加虚拟用户支持
[root@localhost ~]# echo 'guest_enable=YES' >> /etc/vsftpd/vsftpd.conf
[root@localhost ~]# echo 'guest_username=vftp' >> /etc/vsftpd/vsftpd.conf
[root@localhost ~]# systemctl restart vsftpd
[root@localhost ~]# tail -2 /etc/vsftpd/vsftpd.conf 
guest_enable=YES
guest_username=vftp

//为不同的虚拟用户建立独立的配置文件(默认是没有以下两行)
[root@localhost ~]# echo 'user_config_dir=/etc/vsftpd/vusers_dir' >> /etc/vsftpd/vsftpd.conf
[root@localhost ~]# echo 'allow_writeable_chroot=YES' >> /etc/vsftpd/vsftpd.conf
[root@localhost ~]# systemctl restart vsftpd
[root@localhost ~]# tail -2 /etc/vsftpd//vsftpd.conf 
user_config_dir=/etc/vsftpd/vusers_dir
allow_writeable_chroot=YES

//在/etc/vsftpd/vusers_dir目录中为每个虚拟用户分别建立配置文件
//例如,若要使用虚拟用户jerry能够上传文件、创建目录,而harry只有默认的下载权限
//可以执行以下操作
[root@localhost ~]#  mkdir /etc/vsftpd/vusers_dir
[root@localhost ~]# ll /etc/vsftpd/
total 32
-rw-------. 1 root root   125 Oct 30 14:29 ftpusers
-rw-------. 1 root root   361 Oct 30 14:29 user_list
-rw-------. 1 root root  5202 Dec 13 16:27 vsftpd.conf
-rwxr--r--. 1 root root   352 Oct 30 14:29 vsftpd_conf_migrate.sh
-rw-------. 1 root root 12288 Dec 13 16:04 vu.db
drwxr-xr-x. 2 root root     6 Dec 13 16:34 vusers_dir

//设置harry用户可以上传,下载,删除,创建。jerry用户只有下载权限
[root@localhost ~]# cd /etc/vsftpd/vusers_dir/
[root@localhost vusers_dir]# ls
[root@localhost vusers_dir]# touch jerry harry
[root@localhost vusers_dir]# ls
harry  jerry
[root@localhost vusers_dir]# vim harry
[root@localhost vusers_dir]# cat harry
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_umask=022     //可加可不加
[root@localhost vusers_dir]# cat jerry
[root@localhost ~]# systemctl restart vsftpd

5.5FTP应用工具

//安装ftp工具
[root@localhost ~]# yum provides *bin/ftp
Last metadata expiration check: 2:06:31 ago on Wed 13 Dec 2023 02:40:13 PM CST.
ftp-0.17-89.el9.x86_64 : The standard UNIX FTP (File Transfer Protocol) client
Repo        : appstream
Matched from:
Other       : *bin/ftp

[root@localhost ~]# yum -y install ftp
Complete!

//帮助文档
[root@localhost ~]# ftp 192.168.116.140
Connected to 192.168.116.140 (192.168.116.140).
220 (vsFTPd 3.0.5)
Name (192.168.116.140:root): harry
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
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> mkdir abc
257 "/abc" created
ftp> ls
227 Entering Passive Mode (192,168,116,140,162,82).
150 Here comes the directory listing.
drwx------    2 1001     1001            6 Dec 13 09:57 abc
226 Directory send OK.

//上传(把本机的文件上传到ftp中)
[root@localhost ~]# ls
anaconda-ks.cfg

ftp> put anaconda-ks.cfg
local: anaconda-ks.cfg remote: anaconda-ks.cfg
227 Entering Passive Mode (192,168,116,140,110,211).
150 Ok to send data.
226 Transfer complete.
1064 bytes sent in 0.000408 secs (2607.84 Kbytes/sec)
ftp> ls
227 Entering Passive Mode (192,168,116,140,212,49).
150 Here comes the directory listing.
drwx------    2 1001     1001            6 Dec 13 10:07 123
drwx------    2 1001     1001            6 Dec 13 09:57 abc
-rw-------    1 1001     1001         1064 Dec 13 10:18 anaconda-ks.cfg
226 Directory send OK.

//下载
ftp> get 666
local: 666 remote: 666
227 Entering Passive Mode (192,168,116,140,53,121).
150 Opening BINARY mode data connection for 666 (0 bytes).
226 Transfer complete.

[root@localhost ~]# ls
123  666  anaconda-ks.cfg

//删除
ftp> rmdir abc     /删除空目录
250 Remove directory operation successful.
ftp> rmdir 123
250 Remove directory operation successful.
ftp> ls
227 Entering Passive Mode (192,168,116,140,194,20).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Dec 13 10:22 666
-rw-------    1 1001     1001         1064 Dec 13 10:18 anaconda-ks.cfg
226 Directory send OK.

ftp> delete anaconda-ks.cfg    /删除文件
250 Delete operation successful.
ftp> ls
227 Entering Passive Mode (192,168,116,140,48,158).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Dec 13 10:22 666
226 Directory send OK.

//lcd用法
[root@localhost opt]# ls
777  888

ftp> put 777
local: 777 remote: 777
227 Entering Passive Mode (192,168,116,140,62,177).
150 Ok to send data.
226 Transfer complete.
ftp> ls
227 Entering Passive Mode (192,168,116,140,249,56).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Dec 13 10:22 666
-rw-------    1 1001     1001            0 Dec 13 10:28 777
226 Directory send OK.

[root@localhost opt]# ls /data
777

ftp> get 666
local: 666 remote: 666
227 Entering Passive Mode (192,168,116,140,222,91).
150 Opening BINARY mode data connection for 666 (0 bytes).
226 Transfer complete.

[root@localhost opt]# ls
666  777  888

5.6LFTP应用工具

//安装lftp工具
[root@localhost ~]# yum provides *bin/lftp
Last metadata expiration check: 0:00:36 ago on Wed 13 Dec 2023 06:33:59 PM CST.
lftp-4.9.2-4.el9.i686 : A sophisticated file transfer program
Repo        : appstream
Matched from:
Other       : *bin/lftp

lftp-4.9.2-4.el9.x86_64 : A sophisticated file transfer program
Repo        : appstream
Matched from:
Other       : *bin/lftp

[root@localhost ~]# yum -y install lftp
Complete!

//帮助文档
[root@localhost ~]# lftp -u harry,123456 192.168.116.140
lftp harry@192.168.116.140:~> help
    !<shell-command>                     (commands)                           alias [<name> [<value>]]             attach [PID]
    bookmark [SUBCMD]                    cache [SUBCMD]                       cat [-b] <files>                     cd <rdir>
    chmod [OPTS] mode file...            close [-a]                           [re]cls [opts] [path/][pattern]      debug [OPTS] [<level>|off]
    du [options] <dirs>                  edit [OPTS] <file>                   exit [<code>|bg]                     get [OPTS] <rfile> [-o <lfile>]
    glob [OPTS] <cmd> <args>             help [<cmd>]                         history -w file|-r file|-c|-l [cnt]  jobs [-v] [<job_no...>]
    kill all|<job_no>                    lcd <ldir>                           lftp [OPTS] <site>                   ln [-s] <file1> <file2>              ls [<args>]
    mget [OPTS] <files>                  mirror [OPTS] [remote [local]]       mkdir [OPTS] <dirs>                  module name [args]                   more <files>
    mput [OPTS] <files>                  mrm <files>                          mv <file1> <file2>                   mmv [OPTS] <files> <target-dir>
    [re]nlist [<args>]                   open [OPTS] <site>                   pget [OPTS] <rfile> [-o <lfile>]     put [OPTS] <lfile> [-o <rfile>]      pwd [-p]
    queue [OPTS] [<cmd>]                 quote <cmd>                          repeat [OPTS] [delay] [command]      rm [-r] [-f] <files>
    rmdir [-f] <dirs>                    scache [<session_no>]                set [OPT] [<var> [<val>]]            site <site-cmd>                      source <file>
    torrent [OPTS] <file|URL>...         user <user|URL> [<pass>]             wait [<jobno>]                       zcat <files>                         zmore <files>

//创建
lftp harry@192.168.116.140:~> ls
-rw-------    1 1001     1001            0 Dec 13 10:28 777
lftp harry@192.168.116.140:/> mkdir abc
mkdir ok, `abc' created
lftp harry@192.168.116.140:/> ls
-rw-------    1 1001     1001            0 Dec 13 10:28 777
drwx------    2 1001     1001            6 Dec 13 10:41 abc

//上传
[root@localhost ~]# ls
123  666  anaconda-ks.cfg

lftp harry@192.168.116.140:/> ls
-rw-------    1 1001     1001            0 Dec 13 10:28 777
drwx------    2 1001     1001            6 Dec 13 10:41 abc
lftp harry@192.168.116.140:/> put anaconda-ks.cfg
1064 bytes transferred
lftp harry@192.168.116.140:/> ls
-rw-------    1 1001     1001            0 Dec 13 10:28 777
drwx------    2 1001     1001            6 Dec 13 10:41 abc
-rw-------    1 1001     1001         1064 Dec 13 10:46 anaconda-ks.cfg

//下载

5.7wget应用工具

//安装wget
[root@localhost ~]# yum -y install wget
Complete!
[root@localhost ~]# cd test
[root@localhost test]# wget --ftp-user harry --ftp-password 123456
192.168.116.140:/vu.list
--2023-12-13 17:58:27-- ftp://192.168.116.140//vu.list
=> ‘vu.list’
Connecting to 192.168.116.140:21... connected.
Logging in as admin ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD not needed.
==> SIZE vn.list ... 21
==> PASV ... done. ==> RETR vu.list ... done.
Length: 21 (unauthoritative)
vu.list 100%
[================================================================================
=========================>] 21 --.-KB/s in 0s
2023-12-13 17:58:27 (6.04 MB/s) - ‘vu.list’ saved [21]
[root@localhost test]# ls
vu.list

-13 17:58:27-- ftp://192.168.116.140//vu.list
=> ‘vu.list’
Connecting to 192.168.116.140:21… connected.
Logging in as admin … Logged in!
> SYST … done. > PWD … done.
> TYPE I … done. > CWD not needed.
> SIZE vn.list … 21
> PASV … done. > RETR vu.list … done.
Length: 21 (unauthoritative)
vu.list 100%
[
==================================================================
=========================>] 21 --.-KB/s in 0s
2023-12-13 17:58:27 (6.04 MB/s) - ‘vu.list’ saved [21]
[root@localhost test]# ls
vu.list


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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Qt教程 — 3.4 深入了解Qt 控件:Input Widgets部件(3)

目录 1 Input Widgets简介 2 如何使用Input Widgets部件 2.1 Dial 组件-模拟车速表 2.2 QScrollBar组件-创建水平和垂直滚动条 2.3 QSlider组件-创建水平和垂直滑动条 2.4 QKeySequenceEdit组件-捕获键盘快捷键 Input Widgets部件部件较多&#xff0c;将分为三篇文章介绍…

网络基础知识-DNS与DHCP+网络规划与设计故障诊断+嵌入式系统设计师备考笔记

0、前言 本专栏为个人备考软考嵌入式系统设计师的复习笔记&#xff0c;未经本人许可&#xff0c;请勿转载&#xff0c;如发现本笔记内容的错误还望各位不吝赐教&#xff08;笔记内容可能有误怕产生错误引导&#xff09;。 本章的主要内容见下图&#xff1a; 本章知识和计算机…

创意二维码营销案例:帕森斯设计学院在巴黎市中心搭建“沙滩度假地”

作为一个专业的艺术设计学院&#xff0c;帕森斯设计学院&#xff08;Parsons School of Design, The New School&#xff09;以其卓越的教学质量和创新的设计理念享誉全球。 每年的夏天&#xff0c;帕森斯设计学院都会举办一个暑期短期项目&#xff0c;面向全球学生&#xff0…

AI时代,Matter如何融入与服务中国智能家居市场,助力中国企业出海?

随着智能家居产业的飞速发展&#xff0c;丰富多样的智能家居产品为消费者带来了便利的同时&#xff0c;因为不同品牌、不同产品之间的协议与标准不统一&#xff0c;导致消费者体验产生割裂&#xff0c;本来想买个“智能”家居&#xff0c;结果买了个“智障”家居&#xff0c;这…

Qt学习--多态(虚函数)

这次来分享多态的概念&#xff0c;这是比较重要的知识点 面向对象的三大特征&#xff1a;封装、继承、多态 首先&#xff1a;来点官方术语&#xff1a; 多态&#xff0c;通俗来讲就是多种形态&#xff0c;具体点就是去完成某个行为&#xff0c;当不同的对象去完成时会产生出…

软考88-上午题-【操作系统】-进程的状态及状态间的切换

一、三态模型 多道程序系统&#xff1a; 在单道程序系统中&#xff0c;计算机内存中只允许一个程序运行&#xff0c;而多道程序系统则允许多个程序同时运行&#xff0c;从而大大提高了系统的整体性能。 通过允许多个程序同时运行和共享资源&#xff0c;多道程序设计技术使得操作…

使用uniapp,uni-data-select组件时,内容长度没超过容器宽度时候虽然能显示全内容但是数据后边会出现三个点,逼死强迫症

项目场景&#xff1a; 微信小程序开发&#xff0c;使用uniapp&#xff0c;uni-data-select组件时&#xff0c;内容长度没超过容器宽度时候虽然能显示全内容但是数据后边会出现三个点&#xff0c;逼死强迫症 解决方案&#xff1a; 找到组件的源代码&#xff0c;然后删除那三个…

layui2.9.7-入门初学

下载&#xff1a;https://layui.dev/ 下载后解压&#xff1a; 在hbuider中新建一个项目 将如上解压好的文件打开&#xff0c;复制如下到项目中 写案例&#xff0c;基础学习通之前的bootstrap 那样&#xff0c;挨个相中哪个就测试哪个&#xff0c;在这里不再重复罗列&#x…

windows跳板机配置(端口转发)

目录 前言操作步骤端口防火墙开放测试参考 前言 跳板机一般用于异构网络间的中转站&#xff0c;比如对方在防火墙上只给你开放了一台服务器的权限&#xff0c;你无法访问对方局域网的其它主机&#xff0c;但你能访问的这台服务器则有权限访问其它主机。那么这台服务器就可以作…

Docker 从0安装 nacos集群

前提条件 Docker支持一下的CentOs版本 Centos7(64-bit)&#xff0c;系统内核版本为 3.10 以上Centos6.5(64-bit) 或者更高版本&#xff0c;系统内核版本为 2.6.32-431 或者更高版本 安装步骤 使用 yum 安装&#xff08;CentOS 7下&#xff09; 通过 uname -r 命令查看你当…

Go web 基础相关知识

Go web Web工作方式 浏览器本身是一个客户端&#xff0c;当你输入URL的时候&#xff0c;首先浏览器会去请求DNS服务器&#xff0c;通过DNS获取相应的域名对应的IP&#xff0c;然后通过IP地址找到IP对应的服务器后&#xff0c;要求建立TCP连接&#xff0c;等浏览器发送完HTTP …

通过nginx+xray服务搭建及本地配置

一、xray服务配置 下载&#xff1a;https://github.com/XTLS/Xray-core 进入下载界面 这里我选择的是Xray-linux-64.zip 将文件解压到 /usr/local/xray 编辑配置文件/usr/local/xray/config.json uuid可以在v2ray客服端自动生成&#xff0c;也可以在UUID v4 生成器 - KKT…

高性能 MySQL 第四版(GPT 重译)(二)

第四章&#xff1a;操作系统和硬件优化 你的 MySQL 服务器的性能只能和它最弱的环节一样好&#xff0c;而运行 MySQL 的操作系统和硬件通常是限制因素。磁盘大小、可用内存和 CPU 资源、网络以及连接它们的所有组件都限制了系统的最终容量。因此&#xff0c;你需要仔细选择硬件…

腾讯云服务器多少钱一年?听完你可别后悔!

腾讯云服务器多少钱一年&#xff1f;61元一年起。2024年最新腾讯云服务器优惠价格表&#xff0c;腾讯云轻量2核2G3M服务器61元一年、2核2G4M服务器99元一年可买三年、2核4G5M服务器165元一年、3年756元、轻量4核8M12M服务器646元15个月、4核16G10M配置32元1个月、312元一年、8核…

考研数学|张宇还是武忠祥?怎么选?

我觉得张宇老师和武忠祥老师讲课实力都差不多&#xff0c;区别就在于风格的不同 张宇老师的讲课风格比较活泼&#xff0c;擅长调动学生的思维跟着课堂一起走&#xff0c;并且张宇老师发明了很多容易记的段子&#xff0c;但是虽然张宇老师段子多&#xff0c;一点也不妨碍他讲课…

网站制作基本流程|新手必收藏

网站制作基本流程|新手必收藏 我们选择了白嫖雨云的二级域名 浏览器输入https://www.rainyun.com/z22_ 创建账号然后选择一个你喜欢的子域名我建议后缀选择ates.top的 选择自定义地址&#xff0c;类型选择cname 现在要选择记录值了&#xff0c;有a&#xff0c;aa&#xff0c;tx…

数据结构 之 哈希表习题 力扣oj(附加思路版)

哈希表用法 哈希表&#xff1a;键 值对 键&#xff1a;可以看成数组下标&#xff0c;但是哈希表中的建可以是任意类型的&#xff0c;建不能重复,可以不是连续的 值&#xff1a;可以看成数组中的元素&#xff0c;值可以重复&#xff0c;也可以是任意类型的数据 #include<iost…

prompt开发生命周期

1.定义任务场景和成功标准 任务场景可分为简单任务&#xff1a;实体抽取、qa等 复杂任务&#xff1a;代码生成、创意写作等 在定义任务后&#xff0c;就要定义模型实现该任务的成功标准&#xff1a; 模型表现和准确率&#xff1b;延迟&#xff1b;价格。 2.开发测试用例 多…

CPU设计实战—异常处理指令

异常类型以及精确异常的处理 异常有点像中断&#xff0c;处理完还要回到原来的状态&#xff0c;所以需要对之前的状态进行保存。本CPU主要实现对以下异常的处理&#xff1a; 1.外部硬件中断 2.复位异常 3.系统调用异常&#xff08;发生在译码阶段&#xff09; 4.溢出异常&…

Spring6--基于注解管理Bean / 手写IOC

1. 基于注入管理Bean概念 Java 5 引入了注解&#xff08;Annotation&#xff09;这一特性&#xff0c;它允许程序员在源代码中插入元数据&#xff0c;这些元数据以标签形式存在&#xff0c;可以被编译器、类加载器或运行时环境所识别和处理。注解可以帮助开发者在不修改业务逻…
最新文章