











sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
sudo nano /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu/
Suites: noble noble-updates noble-backports noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
其他可选源:
https://mirrors.tuna.tsinghua.edu.cn/ubuntu/https://mirrors.ustc.edu.cn/ubuntu/sudo apt update
sudo apt update
sudo apt install openssh-server -y
sudo systemctl enable --now ssh
sudo ufw allow ssh
sudo ufw reload
/etc/ssh/sshd_config)建议修改:
Port 2222(改默认端口)PermitRootLogin noPasswordAuthentication no(先用密钥登录成功后改)PubkeyAuthentication yes修改后重启:
sudo systemctl restart ssh
客户端生成密钥:ssh-keygen -t ed25519
上传公钥:ssh-copy-id user@ip(默认端口)或 ssh-copy-id -p 端口 user@ip
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。