Oracle Cloud 小鸡设置
更新: 3/5/2025 字数: 0 字 时长: 0 分钟
之前通过 F12 的方法,有幸喜提乌龟壳小鸡两只,在这里记录一下新开系统的一些设置
更新系统
bash
apt update && apt upgrade -y
改为 root 密码登陆
bash
echo root:[密码] | chpasswd root
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
systemctl restart sshd
开启 BBR
bash
# 修改系统变量
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
# 保存生效
sysctl -p
# 查看内核是否已开启BBR
lsmod | grep bbr
# 显示如下,即成功
tcp_bbr 20480 2
同步时间
bash
apt -y install ntpdate
timedatectl set-timezone Asia/Shanghai
ntpdate ntp1.aliyun.com
关闭防火墙
bash
systemctl start supervisord
systemctl disable firewalld
systemctl stop firewalld
放行全部端口(重启失效)
bash
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables-save
持续化规则(重启不失效)
bash
# 安装 iptables-persistent
apt install iptables-persistent
# 永久保存规则
netfilter-persistent save
netfilter-persistent reload
- 对于关闭防火墙更暴力点的方法,可以选择如下两种
bash
rm -rf /etc/iptables && reboot
或
rm -rf /etc/iptables/rules.v4
rm -rf /etc/iptables/rules.v6
reboot
同时你也需要进入后台配置一下入站规则,我是开放的所有协议
DD 重装系统
下方演示为 Debian 10
bash
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 10 -v 64 -a -firmware -p [password] -port [port]
# 将 [password] 替换成自定义的密码
# 将 [port] 替换成自定义的端口号,-port 参数去掉则默认为 22 端口
# -d 表示 Debian 系统,可换成 -u 表示 Ubuntu 系统
# 10 表示系统版本号,Debian可换成 [7, 8, 9, 10, 11]
# Ubuntu 可换成 [14.04, 16.04, 18.04, 20.04]
DD 后添加 ipv6 方法
bash
# 找到 /etc/network/interfaces
# 在这个文件最下面添加一行
iface [设备名] inet6 dhcp
# 将 [设备名] 替换成对应的设备名称,设备名可以在 allow-hotplug 那里找到
# 重启