软件的RPM包制作,VPN服务器,frp连接Linux系统实现内网穿透,systemd简介

  1. root@web1 \~\]# yum -y install rpm-build

  2. root@web1 \~\]# ls /root/rpmbuild #自动生成的目录结构

  3. 将源码软件复制到SOURCES目录 [root@web1 ~]# cp nginx-1.22.1.tar.gz /root/rpmbuild/SOURCES/

rpmbuild创建RPM软件包

    • root@web1 \~\]# rpmbuild -ba /root/rpmbuild/SPECS/nginx.spec

  1. root@web1 \~\]# yum install /root/rpmbuild/RPMS/x86_64/nginx-1.22.1-1.x86_64.rpm

  2. root@web1 \~\]# ls /usr/local/nginx/

VPN服务器 Linux客户端连接WireGuard

制作密钥文件

  1. root@proxy \~\]#cd /usr/local/nginx/html/vpn/linux

  2. root@proxy linux\]# cp public.key ../ser.txt #拷贝一份方便客户端通过浏览器查看

  3. root@proxy linux\]# cat public.key UygBBCi6gEX5aJ0hMpKjBXDxltsV4+yI4NQTqK1ih1k=

  4. GB2NbtPoAEvNufEggKM41GNEUBlxfJfVYn4i9yJ4WlU=

编写配置文件

  1. root@proxy linux\]# cd /etc/wireguard

  2. Interface\] #服务端配置

  3. Address = 10.10.10.1/8 #VPN隧道里面的IP和网段
  4. ListenPort = 54321 #WireGuard服务监听的端口
  5. Peer\] #对端(客户端)配置

  6. AllowedIPs = 10.10.10.2/32 #允许哪些客户端访问VPN服务器 ,32代表ip的二进制32位必须和10.10.10.2一样,也就是ip必须为10.10.10.2的客户才能访问

启动服务,注意,该步骤必须在上述配置文件获取客户端的公钥才可进行

  1. root@proxy wireguard\]# wg-quick up wg #启动VPN服务,wg是之前配置文件的名称

  2. root@proxy wireguard\]# systemctl stop firewalld

步骤二:配置客户端

首先将$教学资料目录/vpn/linux目录拷贝到虚拟机/root下

在客户端安装VPN软件

Windows客户端连接WireGuard

frp连接Linux系统实现内网穿透

  • 熟悉systemctl常用命令
相关推荐
Learn-Share_HY7 分钟前
[Linux]如何設置靜態IP位址?
linux·运维·tcp/ip·ubuntu·static ip
Everbrilliant891 小时前
Ubuntu系统下交叉编译Android的X265库
linux·运维·ubuntu·x265交叉编译·android x265·ffmpeg x265
我不要放纵1 小时前
LVS集群搭建
linux·服务器·lvs
阿巴~阿巴~1 小时前
自主Shell命令行解释器
linux·运维·服务器
许白掰1 小时前
Linux入门篇学习——借助 U 盘或 TF 卡拷贝程序到开发板上
linux·学习·借助 u 盘拷贝程序到开发板上·借助 tf卡拷贝程序到开发板上
SHUIPING_YANG2 小时前
根据用户id自动切换表查询
java·服务器·数据库
chao_7892 小时前
更灵活方便的初始化、清除方法——fixture【pytest】
服务器·自动化测试·python·pytest
枷锁—sha2 小时前
【DVWA系列】——CSRF——Medium详细教程
android·服务器·前端·web安全·网络安全·csrf
枷锁—sha2 小时前
跨站请求伪造漏洞(CSRF)详解
运维·服务器·前端·web安全·网络安全·csrf
scuter_yu2 小时前
腾讯云云服务器深度介绍
服务器·云计算·腾讯云