赞
踩
使用的SSH工具
XTerminal
PS:有这一个就够用了
XTerminal下载地址:https://xterminal.cn/
邀请码:Aa9191
公网ip太难搞了,服务器还卖的贼贵,本地Docker安装Centos7.9并设置Zerotier组局域网满足日常管理,使用Frp内网穿透使得公网可以直接访问
公网服务器推荐雨云,主打的就是一个便宜好用,因为咱只是想要一个公网ip,服务都搭建在本地,找最便宜的就行。
这套教程搭建下来有个演示,效果你们可以自己看看能不能达到要求
Linux CentOS 3.10.0-1160.114.2.el7.x86_64
yum -y update
yum remove docker docker-common docker-selinux docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce
systemctl start docker
systemctl enable docker
直接用汉化版镜像
docker pull 6053537/portainer-ce
docker volume create portainer_data
#运行,容器9000端口映射到9000
docker run -d --name portainer -p 9000:9000 --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data 6053537/portainer-ce
安装完成,浏览器访问http://域名:9000/
docker pull centos:7.9.2009
docker run -itd --name centos7 --privileged --restart=always centos:7.9.2009 /usr/sbin/init
docker exec -it centos7 /bin/bash
yum check-update -y && yum update -y && yum install initscripts screen wget -y
passwd
yum install -y wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y iproute net-tools vim curl openssh-server lrzsz openssh-clients
systemctl start sshd
systemctl enable sshd
PS:远程局域网,作为远程管理方式,无需端口映射,巨好用
curl -s https://install.zerotier.com | bash
systemctl start zerotier-one.service
systemctl enable zerotier-one.service
zerotier-cli join 8bd5124fd6fa70cf
zerotier-cli listnetworks
ip addr
zerotier-one详解:https://cloud.tencent.com/developer/article/2390573
Frp版本0.56.0
用于公网的内网穿透
下载地址:https://github.com/fatedier/frp/releases
Frps与frps.toml上传到有公网IP的服务器上
Frpc与frpc.toml上传到搭建服务的服务器上
#frps.toml bindPort = 13579 #服务通讯端口 vhostHTTPPort = 80 #反向代理http端口 vhostHTTPSPort = 443 #反向代理https端口 #frpc.toml serverAddr = "服务端IP地址" #服务通讯端口,公网ip地址 serverPort = 13579 #服务通讯端口,与frps要保持一致 [[proxies]] #不可修改 name = "web" #服务类型 type = "http" #代理类型 localIP = "127.0.0.1" #本地ip localPort = 80 #反向代理本地http端口 customDomains = ["域名"] #域名 [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 #本地端口 remotePort = 8022 #远程端口
cd /etc/systemd/system/
vim frps.service
[Unit]
Description=frps service
After=network.target
[Service]
Type=simple
ExecStart=/root/frps -c /root/frps.toml
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
systemctl enable frps.service
systemctl start frps.service
systemctl status frps.service
vim frpc.service
[Unit]
Description=frpc service
After=network.target
[Service]
Type=simple
ExecStart=/root/frpc -c /root/frpc.toml
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
systemctl enable frpc.service
systemctl start frpc.service
systemctl status frpc.service
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。