xshell无法连接ssh ubuntu

  • 查看ssh进程是否正常
1. ps -e | grep ssh

在这里插入图片描述

  • 如果出现上图信息,表示ssh服务已启动,修改ssh配置文件信息
2. vi /etc/ssh/sshd_config

3. service ssh restart
报错:
Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit not found.

原因:以上命令都是centos6里面的命令,在centos7需要用:
systemctl restart sshd

在这里插入图片描述

  • 如果 ps -e | grep ssh 显示为空,下载ssh
5. apt-get update 
6. apt-get install -y openssh-server
  • 查看安装情况
7. ps -e | grep ssh
  • 界面出现sshd,其余步骤同上。
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐