软件的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常用命令
相关推荐
序属秋秋秋16 分钟前
《Linux系统编程之开发工具》【实战:倒计时 + 进度条】
linux·运维·服务器·c语言·c++·ubuntu·系统编程
七夜zippoe23 分钟前
Ascend C流与任务管理实战:构建高效的异步计算管道
服务器·网络·算法
刘某的Cloud3 小时前
ceph osd down排查
linux·运维·ceph·系统·osd
安审若无8 小时前
图数据库neoj4安装部署使用
linux·运维·数据库
做运维的阿瑞8 小时前
CentOS DNS故障排查完整解决方案:从症状到根因的系统化诊断
linux·运维·centos
QT 小鲜肉9 小时前
【个人成长笔记】在 Linux 系统下撰写老化测试脚本以实现自动压测效果(亲测有效)
linux·开发语言·笔记·单片机·压力测试
深圳市恒讯科技9 小时前
英国服务器Windows系统远程桌面安装与优化
运维·服务器·windows
itachi-uchiha9 小时前
head和tail命令使用
linux·运维·服务器
violet-lz9 小时前
Socket编程实战:从基础API到多线程服务器
运维·服务器
馨谙10 小时前
SELinux 故障排除完全指南:从拒绝访问到快速修复
linux