Oracle Cloud 小鸡设置
LI SIR Lv4
本文距离上次更新已过去 0 天,部分内容可能已经过时,请注意甄别。

之前通过 F12 的方法,有幸喜提乌龟壳小鸡两只,在这里记录一下新开系统的一些设置


更新系统

1
apt update && apt upgrade -y

改为root密码登陆

1
2
3
4
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

1
2
3
4
5
6
7
8
9
10
11
12
#修改系统变量
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

放行全部端口(重启失效)

1
2
3
4
5
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables-save

持续化规则(重启不失效)

1
2
3
4
5
6
#安装iptables-persistent
apt install iptables-persistent

#永久保存规则
netfilter-persistent save
netfilter-persistent reload
  • 对于关闭防火墙更暴力点的方法,可以选择如下两种
1
2
3
4
5
6
7
rm -rf /etc/iptables && reboot



rm -rf /etc/iptables/rules.v4
rm -rf /etc/iptables/rules.v6
reboot

同时你也需要进入后台配置一下入站规则,我是开放的所有协议

DD 重装系统

下方演示为 Debian 10

1
2
3
4
5
6
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 方法

1
2
3
4
5
#找到/etc/network/interfaces
#在这个文件最下面添加一行
iface <设备名> inet6 dhcp
#将<设备名>替换成对应的设备名称,设备名可以在 allow-hotplug 那里找到
# 重启
 评论
评论插件加载失败
正在加载评论插件
总字数 116.8k 访客数 访问量