一般来说debian系统的VPS或者独立服务器默认都是用的22作为登录SSH的端口,由于弱密码等让一些喜欢扫描端口的怪胎可能有机可乘,就算登录不上也会消耗资源,那如何避免这样的情况呢?我们直接修改SSH默认登录端口22,改为其他的即可。 修改方法: 输入命令:nano /etc/ssh/sshd_config 将默认的Port 22修改为指定端口即可,示例,将端口修改为32873 Port 32873 然后ctrl +x ,退出并保存;提示是否保存,输入y 然后按enter确认。 如果你开启了防火墙,还需要修改防火墙规则里面的端口… 最后重启SSHD服务: systemctl restart sshd
debian11升级12傻瓜式教程:自从centos歇菜之后debian也新增了一波粉丝,队伍壮大了。当前,debian12出来了,抓紧尝鲜下吧,我们来简单、快速地将debian11升级到debian12吧,大致步骤如下: 先更新现有系统: apt update && apt upgrade 再修改debian11的源为debian12的: 如果是香港机器或者内地的机器,推荐用华为的源,复制以下代码直接回车即可: cat > /etc/apt/sources.list << EOF deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib EOF 如果机器在欧美或者其他地方,推荐用linode的源,复制以下代码直接回车即可: cat > /etc/apt/sources.list << EOF deb http://mirrors.linode.com/debian bookworm main non-free-firmware deb-src http://mirrors.linode.com/debian bookworm main non-free-firmware deb http://mirrors.linode.com/debian-security/ bookworm-security main non-free-firmware deb-src http://mirrors.linode.com/debian-security/ bookworm-security main non-free-firmware deb http://mirrors.linode.com/debian bookworm-updates main non-free-firmware deb-src http://mirrors.linode.com/debian bookworm-updates main non-free-firmware EOF 继续更新和升级: apt update && apt full-upgrade 期间会有几次停顿下来,第一次要输入“q”,其余的全部“y” 最后重启系统: reboot