Last Update: 2023-01-26 © Singapore (Oracle Cloud Service)
一个在乌班图(Ubuntu)和德比安(Deian)系统运行的脚本,所有脚本均收集于网络,版权归原作者所有,转载请注明出处; 一个懒人脚本,复制粘贴就可以完成很多任务; 学会偷懒,学会提高工作效率!
wget -N --no-check-certificate https://bou.icu/ubuntu/see_linux_kernel.sh && chmod +x see_linux_kernel.sh && bash see_linux_kernel.sh
众所周知,Ubuntu开启BBR的前提是内核必须等于高于4.9,所以想要使用这个牛逼的玩意儿,需要先看看你的内核是否是4.9或者以上,【原文参考】
wget -N --no-check-certificate https://bou.icu/ubuntu/update_kernel_4.16.sh && chmod +x update_kernel_4.16.sh && bash update_kernel_4.16.sh
wget -N --no-check-certificate https://bou.icu/ubuntu/open_bbr.sh && chmod +x open_bbr.sh && bash open_bbr.sh
wget -N --no-check-certificate https://bou.icu/ubuntu/update_system_apt.sh && chmod +x update_system_apt.sh && bash update_system_apt.sh
wget -N --no-check-certificate https://bou.icu/ubuntu/create_localswap.sh && chmod +x create_localswap.sh && bash create_localswap.sh
sudo vim /etc/fstab文件末尾添加一行/localswap none swap sw 0 0保存退出
sudo vim /etc/sysctl.conf文件末尾添加两行vm.swappiness=50vm.vfs_cache_pressure=30保存退出
sudo vim /etc/ssh/sshd_config找到大约第5行Port 22将数字部分22改为1-65536范围内任意一个你喜欢的数字端口尽量避免与常用端口冲突,如:20/21/22/23/80/443/3389/3306/139/53等
sudo vim /etc/ssh/sshd_config找到 PermitRootLogin -- (有些版本系统里 PermitRootLogin 前面会有#一定要去掉,否正不生效)改为 PermitRootLogin yes 找到 PasswordAuthentication -- (一样如果有#,去掉即可)改为 PasswordAuthentication yes运行 sudo passwd root 重置root密码 -- (部分系统会要求输入当前用户密码)
执行命令 sudo ufw disable显示 Firewall stopped and disabled on system startup 即可
执行命令 sudo apt remove ufw iptables系统询问是否继续操作,回复Y,回车即可完成卸载内置防火墙