ssh连接服务器出现:ssh: connect to host 192.168.1.107 port 22: Connection refused 的解决方法

1 说明遇到问题场景

1、我的系统环境

  • windows10
  • 连接的服务器系统为:Mint19.3

2、我使用windows,在局域网下通过ssh连接服务器报错:ssh: connect to host 192.168.1.107 port 22: Connection refused

shl@shliangPC MINGW64 ~
$ ssh shl@192.168.1.107
ssh: connect to host 192.168.1.107 port 22: Connection refused
shl@shliangPC MINGW64 ~

2 解决方式

我遇到这个原因是因为服务器上没有安装ssh工具,你可以用如下的命令查看,是否有ssh:

/etc/init.d/ssh status

  • 服务器上没有安装ssh时
(base) shl@zhihui-mint:~$ /etc/init.d/ssh status
bash: /etc/init.d/ssh: No such file or directory
(base) shl@zhihui-mint:~$ 
  • 服务器上安装ssh时
(base) shl@zhihui-mint:~$ /etc/init.d/ssh status
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-10-26 18:09:41 CST; 3min 52s ago
 Main PID: 8301 (sshd)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/ssh.service
           └─8301 /usr/sbin/sshd -D

1026 18:09:41 zhihui-mint systemd[1]: Starting OpenBSD Secure Shell server...
1026 18:09:41 zhihui-mint sshd[8301]: Server listening on 0.0.0.0 port 22.
1026 18:09:41 zhihui-mint sshd[8301]: Server listening on :: port 22.
1026 18:09:41 zhihui-mint systemd[1]: Started OpenBSD Secure Shell server.
1026 18:10:04 zhihui-mint sshd[8934]: Accepted password for shl from 192.168.1.114 port 10020 ssh2
1026 18:10:04 zhihui-mint sshd[8934]: pam_unix(sshd:session): session opened for user shl by (uid=0)
(base) shl@zhihui-mint:~$ 

解决方法:在Mint / Ubuntu上安装ssh

sudo apt-get install ssh

之后使用FTP软件,如FIlezilla也是可以连接到服务器的!!!

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 猿与汪的秘密 设计师:白松林 返回首页