Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-97-generic x86_64)
* Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro Last login: Sat Mar 2 16:23:35 2024 from ***.***.***.***
1.1 SSH 安全配置
修改默认 ssh 端口 22 -> 1122,这个端口容易被攻击。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
vim /etc/ssh/sshd_config # 修改端口 Port 1122 # 限制登录尝试次数 MaxAuthTries 3 # 设置登录超时时间 LoginGraceTime 60 # 禁用空密码登录 PermitEmptyPasswords no # 重启 sshd 服务 systemctl restart sshd
vim /etc/apt/sources.list ## Note, this file is written by cloud-init on first boot of an instance ## modifications made here will not survive a re-bundle. ## if you wish to make changes you can: ## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg ## or do the same in user-data ## b.) add sources in /etc/apt/sources.list.d ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy main restricted # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates main restricted # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy universe # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy universe deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates universe # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy multiverse # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy multiverse deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates multiverse # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-backports main restricted universe multiverse # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-backports main restricted universe multiverse
deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security main restricted # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security main restricted deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security universe # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security universe deb http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security multiverse # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu jammy-security multiverse