SSH连接被拒绝(Linux deepin系统)

SSH连接被拒绝

例如下面这种情况

root@ubuntu:~$ ssh xuegao@192.168.0.2
ssh: connect to host 192.168.0.2 port 22: Connection refused

排除防火墙的情况的话(端口被关闭),大概率就是SSH服务处于不活跃状态。例如我用的deepin系统似乎默认就是关闭的,可以连接其它终端,但在其它终端无法连接本机。

使用service ssh status查看状态,发现确实处于inactive状态。

root@deepin:~$ service ssh status
○ ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:sshd(8)
             man:sshd_config(5)

那么使用service ssh start命令启动服务,然后再查看状态就是active了,这时其它终端再进行SSH连接请求就不会被拒绝了。

root@deepin:~$ service ssh start
root@deepin:~$ service ssh status
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-07-27 10:00:19 CST; 2s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 36936 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 36937 (sshd)
      Tasks: 1 (limit: 45426)
     Memory: 1.9M
     CGroup: /system.slice/ssh.service
             └─36937 /usr/sbin/sshd -D
  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值