Page 1 of 1

why "sshd.service failed"?

Posted: 2016/01/17 18:37:25
by ipfreak
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.

Re: why "sshd.service failed"?

Posted: 2016/01/17 19:08:02
by TrevorH
Check your logs to see why it stopped.

Re: why "sshd.service failed"?

Posted: 2016/01/17 20:40:18
by ipfreak
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!