跳至主要內容

网络知识

naijoug大约 3 分钟

reference


Tool

  • curlopen in new window 👉🏻 🐙open in new window

    A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features

  • HTTPieopen in new window 👉🏻 🐙open in new window

    🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.

  • Proxymanopen in new window 👉🏻 🐙open in new window

    Modern and Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️


内网穿透

concept

abbrfulldescription
OSIOpen System Interconnection开放式系统互联通信参考模型
CACertificate Authority证书颁发机构
IPInternet Protocol网络传输协议
TCPTransmission Control Protocol传输控制协议
UDPUser Datagram Protocol用户数据报协议
HTTPHyper Text Transfer Protocol超文本传输协议
HTTPSHyper Text Transfer Protocol Secure超文本安全传输协议
QUICQuick UDP Internet Connections快速 UDP 网络连接协议
DNSDomain Name Server域名解析服务器
IMInstant Messaging即时通讯
SSHSecure Shell安全(加密) Shell
CDNContent Delivery Network内容分发网络
VPNVirtual Private Network虚拟私人网络
VPSVirtual Private Server虚拟专用服务器技术
  • TCP & UDP & HTTP

    类型特点说明应用
    TCP\IP传输速度慢,不容易丢包传输协议,长连接聊天
    UDP传输速度快,容易丢包传输协议,长连接局域网游戏,网络游戏
    HTTP传输速度慢,单次传输超文本传输协议,短连接网站

OSI 模型 (Open Systems Interconnection Model)

国际标准组织定义的开放式系统环境通信协议

  • 物理层 (Physical Layer)
  • 数据链路层 (Data Link Layer)
  • 网络层 (Network Layer)
  • 传输层 (Transport Layer)
  • 会话层 (Session Layer)
  • 表示层 (Presentation Layer)
  • 应用层 (Application Layer)

TCP/IP

DNS

DNS 解析 : 域名到 IP 地址的映射,DNS 解析使用 UDP 数据报,端口号 53,采用明文传输。

解析方式说明
递归查询不断地自下而上遍历解析 我去给你问一下
迭代查询我告诉你谁可能知道
解析记录说明
A 记录(Address)
NS 记录(Name Server)
MX 记录(Mail Exchange)
CNAME 记录(Canonical Name)
TXT 记录(Textfile)
TTL 值(Time-To-Live)
PTR 值(Pointer)

SSH

# 安装 openssh
$ sudo apt-get update # 更新系统工具和依赖
$ sudo apt-get install openssh-server openssh-client
  
# 启用 openssh
$ /etc/init.d/ssh start       # 启动
$ /etc/init.d/ssh stop        # 停止
$ /etc/init.d/ssh restart     # 重新启动
# 利用 service 启用
$ sudo service ssh start      # 启动
$ sudo service ssh stop       # 停止
$ sudo service ssh restart    # 重新启动

# 启用账户 & 密码登录
#   1. 修改 PasswordAuthentication 为 yes
$ sudo vim /etc/ssh/sshd_config 
#   2. 重启 ssh 服务
$ sudo service sshd restart

# 私钥登录
#   方案一 : 将本机
$ ssh-keygen                # 创建 ssh 密钥对(~/.ssh/id_rsa.pub)
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" 
$ ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa-xxx
#   -t : 加密算法(默认: RSA)
#   -b : 秘钥长度(默认: 2048)
#   -C : 指定秘钥的用户信息
$ ssh-copy-id user@host     # 复制本机公钥到目标主机(~/.ssh/authorized_keys)
#   方案二 : 私钥文件直接登录
$ chmod 400 private_key.pem # 添加权限
$ ssh -i private_key.pem user@host