服务器U盘安装Ubuntu
- 制作一个Ubuntu安装盘
- DELL服务器F11进入BOOT Manager,选择U盘启动
- 按照安装引导安装即可
- 安装过程中两点
- 分区,根据服务器的用途考虑给多少空间,我这里默认创建逻辑卷并且给了全部空间,主要是虚拟化用
- 初始安装的更新源更换成国内源
ubuntu2204初始化系统
- 关闭防火墙
- 关闭selinux
- 时间同步-ntp
- yum仓建设或镜像源更换
- 根据情况开启路由转发
- 更改/etc/needrestart 自动重启提示选项
- ssh服务器配置开启ssh授权xshell工具登录
- /etc/ssh/sshd_config 中 PermitRootLogin yes
- 同一网卡名称
- 修改 /etc/default/grub 在 GRUB_CMDLINE_LINUX 行后面加上 net.ifnames=0
- grub-mkconfig -o /boot/grub/grub.cfg 读取配置文件
- 配置网络
- /etc/netplan
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
eth1:
dhcp4: no
dhcp6: no
bonds:
bond0:
interfaces:
- eth0
- eth1
addresses: [192.168.11.10/24]
gateway4: 192.168.11.1
nameservers:
addresses: [223.6.6.6,223.5.5.5]
parameters:
mode: active-backup
mii-monitor-interval: 100
fail-over-mac-policy: active
- 安装常用软件包
apt update
apt -y purge ufw lxd lxcfs liblxc-common
apt -y install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev gcc openssh-server iotop unzip zip psmisc vim net-tools inetutils-ping bridge-utils libosinfo-bin
apt -y install qemu-kvm virt-manager libvirt-daemon-system --虚拟化工具
- reboot重启
- 内网穿透
- 需要获取一个免费的公网ip,可以使用花生壳等第三方应用或者注册一个
root@ubuntu2204:/opt# wget "https://down.oray.com/hsk/linux/phddns_5.2.0_amd64.deb" -O phddns_5.2.0_amd64.deb
--2023-02-04 03:22:11-- https://down.oray.com/hsk/linux/phddns_5.2.0_amd64.deb
Resolving down.oray.com (down.oray.com)... 240e:95d:c01:200:3::3fe, 240e:95d:c01:200:3::3fd, 111.170.130.243, ...
Connecting to down.oray.com (down.oray.com)|240e:95d:c01:200:3::3fe|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 309304 (302K) [application/octet-stream]
Saving to: ‘phddns_5.2.0_amd64.deb’
phddns_5.2.0_amd64.deb 100%[============================================================================================>] 302.05K --.-KB/s in 0.04s
2023-02-04 03:22:11 (7.41 MB/s) - ‘phddns_5.2.0_amd64.deb’ saved [309304/309304]
root@ubuntu2204:/opt# dpkg -i phddns_5.2.0_amd64.deb
Selecting previously unselected package phddns.
(Reading database ... 89886 files and directories currently installed.)
Preparing to unpack phddns_5.2.0_amd64.deb ...
Unpacking phddns (5.2.0) ...
Setting up phddns (5.2.0) ...
in systemv
Installation, please later...
Successful installation of Phddns Service.
....
root@ubuntu2204:/opt# phddns restart
restart phtunnel service success !
- 客户端注册安装花生壳使用即可