why "sshd.service failed"?

Support for security such as Firewalls and securing linux
Post Reply
ipfreak
Posts: 18
Joined: 2015/12/30 16:53:29

why "sshd.service failed"?

Post by ipfreak » 2016/01/17 18:37:25

hello all:

i am trying to login my centos 7 remotely via ssh but the attempts were rejected:

user@lab:~:$ ssh mlu@192.168.1.10
ssh: connect to host 192.168.1.10 port 22: Connection refused
user@lab:~:$ ssh mlu@192.168.1.10
ssh: connect to host 192.168.1.10 port 22: Connection refused


i used nmap and trying to find out which ports are open:

user@lab:~:$ nmap -v 192.168.1.10

Starting Nmap 7.01 ( https://nmap.org ) at 2016-01-16 19:20 EST
Initiating Ping Scan at 19:20
Scanning 192.168.1.10 [2 ports]
Completed Ping Scan at 19:20, 0.00s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 19:20
Completed Parallel DNS resolution of 1 host. at 19:20, 0.03s elapsed
Initiating Connect Scan at 19:20
Scanning 192.168.1.10 [1000 ports]
Increasing send delay for 192.168.1.10 from 0 to 5 due to max_successful_tryno increase to 4
Increasing send delay for 192.168.1.10 from 5 to 10 due to max_successful_tryno increase to 5
Increasing send delay for 192.168.1.10 from 10 to 20 due to max_successful_tryno increase to 6
Increasing send delay for 192.168.1.10 from 20 to 40 due to max_successful_tryno increase to 7
Increasing send delay for 192.168.1.10 from 40 to 80 due to max_successful_tryno increase to 8
Increasing send delay for 192.168.1.10 from 80 to 160 due to max_successful_tryno increase to 9
Increasing send delay for 192.168.1.10 from 160 to 320 due to max_successful_tryno increase to 10
Warning: 192.168.1.10 giving up on port because retransmission cap hit (10).
Connect Scan Timing: About 8.82% done; ETC: 19:26 (0:05:21 remaining)
Increasing send delay for 192.168.1.10 from 320 to 640 due to 11 out of 20 dropped probes since last increase.
Connect Scan Timing: About 11.82% done; ETC: 19:29 (0:07:35 remaining)
Increasing send delay for 192.168.1.10 from 640 to 1000 due to 11 out of 19 dropped probes since last increase.
Connect Scan Timing: About 14.65% done; ETC: 19:31 (0:08:50 remaining)
Connect Scan Timing: About 17.65% done; ETC: 19:32 (0:09:24 remaining)
Connect Scan Timing: About 38.35% done; ETC: 19:35 (0:08:49 remaining)
Connect Scan Timing: About 44.65% done; ETC: 19:35 (0:08:06 remaining)
Connect Scan Timing: About 50.65% done; ETC: 19:35 (0:07:20 remaining)
Connect Scan Timing: About 56.55% done; ETC: 19:35 (0:06:33 remaining)
Connect Scan Timing: About 61.95% done; ETC: 19:36 (0:05:48 remaining)
Connect Scan Timing: About 67.35% done; ETC: 19:36 (0:05:01 remaining)
Connect Scan Timing: About 72.75% done; ETC: 19:36 (0:04:12 remaining)
Connect Scan Timing: About 78.05% done; ETC: 19:36 (0:03:25 remaining)
Connect Scan Timing: About 83.15% done; ETC: 19:36 (0:02:38 remaining)
Connect Scan Timing: About 88.25% done; ETC: 19:36 (0:01:50 remaining)
Connect Scan Timing: About 93.35% done; ETC: 19:36 (0:01:03 remaining)
Completed Connect Scan at 19:37, 993.57s elapsed (1000 total ports)
Nmap scan report for 192.168.1.10
Host is up (0.0042s latency).
Not shown: 989 closed ports
PORT STATE SERVICE
43/tcp filtered whois
5357/tcp filtered wsdapi
5910/tcp filtered cm
8045/tcp filtered unknown
8100/tcp filtered xprint-server
8292/tcp filtered blp3
10012/tcp filtered unknown
11110/tcp filtered unknown
49159/tcp filtered unknown
50006/tcp filtered unknown
50500/tcp filtered unknown

i checked the centos machine itself:

[user@centOS7 ~]$ systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2016-01-17 13:21:05 EST; 22s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 15891 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
Main PID: 15891 (code=exited, status=255)

Jan 17 13:21:05 bowerbird systemd[1]: Unit sshd.service entered failed state.
Jan 17 13:21:05 bowerbird systemd[1]: sshd.service failed.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: why "sshd.service failed"?

Post by TrevorH » 2016/01/17 19:08:02

Check your logs to see why it stopped.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ipfreak
Posts: 18
Joined: 2015/12/30 16:53:29

Re: why "sshd.service failed"?

Post by ipfreak » 2016/01/17 20:40:18

TrevorH wrote:Check your logs to see why it stopped.
thanks. i fixed it. i changed ssh port number (/etc/ssh/sshd_config) and it didn't work, so i changed back , for some reasons it killed the service. in the end, i used "semanage" per follow link:

http://sharadchhetri.com/2014/10/15/cen ... x-enabled/

thanks again!

Post Reply