准备
修改ssh文件(/etc/ssh/sshd_config
) 在该文件中添加以下内容
PasswordAuthentication yes
更新系统
sudo apt-get update
sudo apt-get upgrade
配置gost
安装gost
wget https://github.com/ginuerzh/gost/releases/download/v2.11.5/gost-linux-amd64-2.11.5.gz
gzip gost-linux-amd64-2.11.5.gz -d
mkdir wk && cd wk
mv ../gost-linux-amd64-2.11.5.gz gost && chmod +x gost
添加配置文件gost.json
{
"Debug": false,
"Retries": 0,
"ServeNodes": [
"tcp://:本地端口/矿池地址:矿池端口"
],
"ChainNodes": [
"relay+tls://指定用户:指定密码@加密服务器地址:服务器端口"
]
}
为gost添加服务 保证开机即可启动 /etc/systemd/system/gost.service
[Unit]
Description=gost
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
DynamicUser=true
ExecStart=/path/to/wk/gost -C /path/to/wk/gost.json
[Install]
WantedBy=multi-user.target
启动服务
# 刷新服务
systemctl daemon-reload
# 开启gost服务
systemctl start gost
# 设置开机自动启动gost服务
systemctl enable gost
修改网关 固定IP
修改之前需要将00-installer-config.yaml
备份以下
cd /etc/netplan
cp 00-installer-config.yaml 00-installer-config.yaml1
将00-installer-config.yaml
改成以下内容
# This is the network config written by 'subiquity'
network:
ethernets:
enp1s0:
dhcp4: no
addresses:
- 192.168.1.250/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 223.5.5.5
- 8.8.8.8
version: 2
最后执行以下命令生成
sudo netplan apply