Ubuntu服务器启动ssh service

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012494820/article/details/78007627

  Ubuntu服务器一般由多个用户同时使用,需要使用ssh远程登录。当服务器之前装过ssh,以后出问题重装ssh的时候,可能遇到ssh-server无法启动的问题。本博客记录踩过的坑和解决方法。

  现象:正常安装ssh service流程包括安装server和client,并修改config文件。但按照此操作,会出现如下现象:

service ssh start

提示,Job is already runing

ps -e | grep ssh

看不到任何与ssh有关的进程,且ssh localhost命令会遇到 connection to localhost port 22 refused,即ssh服务未开启。

  解决方法:问题的原因是未彻底卸载ssh服务,借鉴明日韭菜的博客,使用

sudo apt-get remove --purge openssh-server
并根据提示使用

sudo apt-get autoremove openssh-server
彻底卸载ssh服务,再次重装,可以解决问题。


猜你喜欢

转载自blog.csdn.net/u012494820/article/details/78007627