在 Ubuntu 上“卸载 SSH 服务”通常指卸载并停止 OpenSSH Server(sshd)。下面按常见场景说明。
dpkg -l | grep openssh-server
或
systemctl status ssh
sudo systemctl stop ssh
sudo systemctl disable ssh
sudo apt remove openssh-server
sudo apt purge openssh-server
sudo apt autoremove
如果你只是不想开机启动或暂时不能用 SSH:
sudo systemctl disable --now ssh
如果还想卸载 SSH 客户端:
sudo apt remove openssh-client
⚠️ 注意:某些系统工具可能依赖 openssh-client,一般不推荐。
which sshd
无输出即表示 SSH 服务已移除。
如果你告诉我:
我可以给你更精确的操作建议。