1. 安装vim
apt  install vim

2.修改sshd_config

sed -i 's PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
重启sshd
systemctl restart sshd

3.查询内核版本

dpkg -l | grep linux-image

4.移除内核

apt purge linux-image-4.19.0-13-amd64 linux-image-4.19.0-8-amd64 linux-image-amd64

5.更新grub

update-grub

6.下载kernel

//kernel.ubuntu.com/~kernel-ppa/mainline/v5.10.10/

7.安装内核

dpkg -i linux-headers-5.10.10-051010_5.10.10-0linux-headers-5.10.10-051010-generic_5.10.10-051010.202101231639_amd64.deb51010.202101231639_all.deb
dpkg -i linux-image-unsigned-5.10.10-051010-genlinux-modules-5.10.10-051010-generic_5.10.10-051010.202101231639_amd64.deberic_5.10.10-051010.202101231639_amd64.deb

8.更新grub

update-grub

9.修改sysctl.conf

vm.swappiness = 0
fs.file-max = 1024000
fs.inotify.max_user_instances = 8192
vm.overcommit_memory = 1
net.ipv4.neigh.default.base_reachable_time_ms = 600000
net.ipv4.neigh.default.mcast_solicit = 20
net.ipv4.neigh.default.retrans_time_ms = 250
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.core.rmem_default = 6291456
net.core.wmem_default = 6291456
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.core.somaxconn = 262114
net.core.netdev_max_backlog = 262114
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_max_orphans = 262114
net.ipv4.ip_forward = 1
net.ipv4.tcp_mtu_probing = 1
net.ipv4.tcp_fastopen = 3
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

10.声明环境变量

export PATH=/usr/local/nginx/sbin:/usr/local/php/bin:/usr/local/curl/bin:/usr/local/openssl/bin:/usr/local/apache/bin:/usr/local/mariadb
/bin:$PATH

11.设置文件最大值

ulimit -SHn 65535