admin管理员组

文章数量:1530975

睿洛医疗

0,准备
    

轻易不要搞,弄不好就成砖头了。
多开几个远程连接,避免安装过程中断掉。

1,完全卸载
    

sudo apt-get remove openssh-server openssh-client --purge -y

2,openssh安装
    

apt-get install openssh-server openssh-client

3,openssh重启
  

 systemctl restart ssh

4,可能的问题1:

apt源不可用,无法安装

解决办法:

查看系统版本

cat /etc/issue

更新安装源,按自己系统版本替换内容

vim /etc/apt/sources.list

Ubuntu 14.04

deb https://mirrors.aliyun/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun/ubuntu/ trusty-security main restricted universe multiverse

deb https://mirrors.aliyun/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun/ubuntu/ trusty-updates main restricted universe multiverse

deb https://mirrors.aliyun/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun/ubuntu/ trusty-backports main restricted universe multiverse

## Not recommended
# deb https://mirrors.aliyun/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun/ubuntu/ trusty-proposed main restricted universe multiverse

ubuntu 16.04

deb http://mirrors.aliyun/ubuntu/ xenial main
deb-src http://mirrors.aliyun/ubuntu/ xenial main

deb http://mirrors.aliyun/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun/ubuntu/ xenial-updates main

deb http://mirrors.aliyun/ubuntu/ xenial universe
deb-src http://mirrors.aliyun/ubuntu/ xenial universe
deb http://mirrors.aliyun/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun/ubuntu/ xenial-security main
deb http://mirrors.aliyun/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun/ubuntu/ xenial-security universe

ubuntu 18.04

deb http://mirrors.aliyun/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ bionic-updates main restricted universe multiverse

# deb http://mirrors.aliyun/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ bionic-backports main restricted universe multiverse

ubuntu 20.04

deb http://mirrors.aliyun/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ focal-updates main restricted universe multiverse

# deb http://mirrors.aliyun/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun/ubuntu/ focal-backports main restricted universe multiverse

替换后更新

apt update

再装,成功

apt-get install openssh-server openssh-client

5,可能的问题2:

无法启动openBSD

 解决办法:

因为没卸载干净或者还原了旧的配置文件。卸载干净再装就好了。(openssh的配置文件很简单,就几个开关不用备份)

sudo apt-get remove openssh-server openssh-client --purge -y

6,可能的问题3:

openssh安装且重启成功后,测试远程链接。

 解决办法:

ssh-keygen -R 8.14.XX.XX

参考:阿里云开发者社区https://developer.aliyun/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11IOP122

本文标签: 重装UbuntuOpenSSH