文件内容参考(适配 OpenSSH 9.0p1):‌OpenSSH 9.0p1 完全卸载与编译安装保姆级指南

适用环境‌:Ubuntu/Debian 系统,需 root 权限或 sudo 权限。


一、彻底卸载旧版本 OpenSSH(ubuntu自带的)

1. 卸载所有 OpenSSH 组件
# 停止 SSH 服务 
sudo systemctl stop ssh sshd 
# 卸载 openssh-server 和 openssh-client 
sudo apt purge openssh-server openssh-client -y 
# 清理残留配置和依赖 
sudo apt autoremove -y 
# 强制删除旧配置文件
sudo rm -rf /etc/ssh/ 

文件内容参考(适配 OpenSSH 9.0p1):‌OpenSSH 9.0p1 完全卸载与编译安装保姆级指南_第1张图片

2. 检查是否卸载干净
# 确认无残留的 SSH 服务进程 
ps aux | grep sshd 
# 验证系统默认 SSH 版本 
ssh -V # 预期输出:提示未安装或旧版本残留(需重启后检查)

你可能感兴趣的:(网络,ubuntu,debian,linux,ssh)