From a257fa0c17aafc11a4d46ce22a3dedcdc2dba556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E7=B4=A0=E8=90=8D?= <11802846+zeng-suping@user.noreply.gitee.com> Date: Tue, 18 Jun 2024 15:14:45 +0000 Subject: [PATCH 1/3] =?UTF-8?q?update=20=E6=9B=BE=E7=B4=A0=E8=90=8D/0618.m?= =?UTF-8?q?d.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曾素萍 <11802846+zeng-suping@user.noreply.gitee.com> --- "\346\233\276\347\264\240\350\220\215/0618.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/\346\233\276\347\264\240\350\220\215/0618.md" "b/\346\233\276\347\264\240\350\220\215/0618.md" index 5ff140a..de0406f 100644 --- "a/\346\233\276\347\264\240\350\220\215/0618.md" +++ "b/\346\233\276\347\264\240\350\220\215/0618.md" @@ -214,8 +214,8 @@ a.sh ```bash -upset MY_AGE -upset PATH +unset MY_AGE +unset PATH ``` ### 练习题 10: 修改默认器 -- Gitee From af7bd8739edc41b8e53838821cd60d69794fb067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E7=B4=A0=E8=90=8D?= <11802846+zeng-suping@user.noreply.gitee.com> Date: Tue, 18 Jun 2024 15:52:58 +0000 Subject: [PATCH 2/3] =?UTF-8?q?update=20=E6=9B=BE=E7=B4=A0=E8=90=8D/0618.m?= =?UTF-8?q?d.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曾素萍 <11802846+zeng-suping@user.noreply.gitee.com> --- "\346\233\276\347\264\240\350\220\215/0618.md" | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/\346\233\276\347\264\240\350\220\215/0618.md" "b/\346\233\276\347\264\240\350\220\215/0618.md" index de0406f..d902c54 100644 --- "a/\346\233\276\347\264\240\350\220\215/0618.md" +++ "b/\346\233\276\347\264\240\350\220\215/0618.md" @@ -175,8 +175,8 @@ export PATH=$PATH:/root 将`/tmp`添加到你的`PATH`环境变量的开始位置,(注意:这可能会覆盖其他路径中的同名命令,所以请谨慎操作)。 -``` - +```bash +export PATH=/tmp:$PATH ``` ### 练习题 7: 验证`PATH`的修改 @@ -185,7 +185,7 @@ export PATH=$PATH:/root ```bash -export PATH=/tmp:$PATH +echo $PATH | grep /root/home/PATH ``` ### 练习题 8: 永久设置环境变量 -- Gitee From 5f90f69d686589fac0cc5815623709d22c463ed5 Mon Sep 17 00:00:00 2001 From: zeng <1838202451@qq.com> Date: Mon, 1 Jul 2024 18:38:49 +0800 Subject: [PATCH 3/3] 25 --- .../0625.md" | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 "\346\233\276\347\264\240\350\220\215/0625.md" diff --git "a/\346\233\276\347\264\240\350\220\215/0625.md" "b/\346\233\276\347\264\240\350\220\215/0625.md" new file mode 100644 index 0000000..e3ed377 --- /dev/null +++ "b/\346\233\276\347\264\240\350\220\215/0625.md" @@ -0,0 +1,62 @@ +#### 网络有关的命令 + +##### ip (ifconfig) + +- address +- route + +##### ping + +##### wget + +##### curl + +##### netset =>ss + +- ss-tunl 查看以数字端口的形式显示正在监听的TCP和UDP端口 +- ss-tuna 以数字的形式显示所有的TCP和UDP端口 + +#### 如何通过进程号反查服务名 + +``` +ps -ef | grep 进程号 +ps -aux | grep 进程号 +ss -np | grep 进程号 +``` + +##### 结束服务所有的进程 + +``` +killall 服务名 +pkill =>pgrep + kill +``` + +网络安全:端口安全,禁用非法访问端口,只允许指定的端口开放 + +防火墙:firewall,一种安全机制,一种访问规则,相当于一个门卫,安全组 + +ufw:ubantu默认防火墙,但Debian没安装,要自己安装 + +``` +apt update +apt upgrade +apt install ufw -y +``` + +防火墙:不被允许的,默认就是禁止的 + +``` +1、ufw allow 端口号/协议 + ufw allow 22/tcp +2、开放80端口,允许通行 +ufw allow 80/tcp +3、查看防火墙的状态 +ufw status +4、重新加载新配置 +ufw reload +5、禁用 +ufw deny 协议 | 端口 | 端口/协议 +6、删除 +ufw delete 第几个 +``` + -- Gitee