ssh: connect to host xxx.xx.xx.xx port 22: Connection refused原因以及解决方案

起因是我用电脑a通过ssh连到了电脑b,在电脑b上打算用scp把文件拷贝过来,结果报了这么个错误

ssh: connect to host xxx.xx.xx.xx port 22: Connection refused

调查发现从电脑b ping 电脑a这条路是通的,而且从电脑a scp 到电脑b也是可行的,因此原因出在电脑a上面。

在电脑a上,我先是开了端口22

sudo ufw allow 22 

发现还是不行,后来发现电脑a上没装ssh服务器——sshd,原来如此,那就简单了

 sudo apt update 

sudo apt install openssh-server

sudo systemctl status ssh

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 18:16:03       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 18:16:03       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 18:16:03       58 阅读
  4. Python语言-面向对象

    2024-07-12 18:16:03       69 阅读

热门阅读

  1. 华为的服务器创新之路

    2024-07-12 18:16:03       21 阅读
  2. 新版k8s拉取镜像失败问题

    2024-07-12 18:16:03       21 阅读
  3. 每日一题~p4447(贪心)

    2024-07-12 18:16:03       17 阅读
  4. windows server安装mino

    2024-07-12 18:16:03       22 阅读
  5. matlab实现pid控制液压系统

    2024-07-12 18:16:03       22 阅读
  6. 大整数加法C++

    2024-07-12 18:16:03       20 阅读